@@ -42,7 +42,7 @@ |
||
| 42 | 42 | * |
| 43 | 43 | * @param Request $request Request data containing all projects. |
| 44 | 44 | * |
| 45 | - * @return \Illuminate\Http\Response |
|
| 45 | + * @return \Illuminate\Http\JsonResponse |
|
| 46 | 46 | */ |
| 47 | 47 | public function update(Request $request) |
| 48 | 48 | { |
@@ -18,11 +18,11 @@ |
||
| 18 | 18 | { |
| 19 | 19 | $projects = Project::all()->sortBy('order')->values(); |
| 20 | 20 | |
| 21 | - $projectImages = $projects->mapWithKeys(function (Project $project) { |
|
| 21 | + $projectImages = $projects->mapWithKeys(function(Project $project) { |
|
| 22 | 22 | return [$project->name() => $project->getProjectImageUrl()]; |
| 23 | 23 | })->objectIfEmpty(); |
| 24 | 24 | |
| 25 | - $projectBlocks = $projects->mapWithKeys(function (Project $project) { |
|
| 25 | + $projectBlocks = $projects->mapWithKeys(function(Project $project) { |
|
| 26 | 26 | return [$project->name() => $project->getProjectBlockText()]; |
| 27 | 27 | })->objectIfEmpty(); |
| 28 | 28 | |
@@ -2,11 +2,11 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Illuminate\Support\Collection; |
| 4 | 4 | |
| 5 | -if (! Collection::hasMacro('objectIfEmpty')) { |
|
| 5 | +if (!Collection::hasMacro('objectIfEmpty')) { |
|
| 6 | 6 | /* |
| 7 | 7 | * Dump the arguments given followed by the collection. |
| 8 | 8 | */ |
| 9 | - Collection::macro('objectIfEmpty', function () { |
|
| 9 | + Collection::macro('objectIfEmpty', function() { |
|
| 10 | 10 | if ($this->isEmpty()) { |
| 11 | 11 | return new \stdClass(); |
| 12 | 12 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -Route::group(['middleware' => ['web', 'admin']], function () { |
|
| 3 | +Route::group(['middleware' => ['web', 'admin']], function() { |
|
| 4 | 4 | Route::get('/manager', 'Larafolio\Http\Controllers\PortfolioController@index')->name('dashboard'); |
| 5 | 5 | |
| 6 | 6 | Route::patch('/manager', 'Larafolio\Http\Controllers\PortfolioController@update')->name('update-portfolio'); |