@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * Update image name and caption. |
| 12 | 12 | * |
| 13 | 13 | * @param \Illuminate\Http\Request $request Request object. |
| 14 | - * @param Larafolio\Models\Image $image Image to be updated. |
|
| 14 | + * @param Image $image Image to be updated. |
|
| 15 | 15 | * |
| 16 | 16 | * @return \Illuminate\Http\Response |
| 17 | 17 | */ |
@@ -31,7 +31,7 @@ discard block |
||
| 31 | 31 | /** |
| 32 | 32 | * Remove image from portfolio. |
| 33 | 33 | * |
| 34 | - * @param Larafolio\Models\Image $image Image to be removed. |
|
| 34 | + * @param Image $image Image to be removed. |
|
| 35 | 35 | * |
| 36 | 36 | * @return \Illuminate\Http\Response |
| 37 | 37 | */ |
@@ -11,9 +11,9 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * Remove a link. |
| 13 | 13 | * |
| 14 | - * @param Larafolio\Models\Link $link Link to remove. |
|
| 14 | + * @param Link $link Link to remove. |
|
| 15 | 15 | * |
| 16 | - * @return \Illuminate\Http\Response |
|
| 16 | + * @return \Illuminate\Http\JsonResponse |
|
| 17 | 17 | */ |
| 18 | 18 | public function destroy(Link $link) |
| 19 | 19 | { |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * @param Request $request Http request with 'url'. |
| 29 | 29 | * @param HttpValidator $httpValidator Instance of http validator class. |
| 30 | 30 | * |
| 31 | - * @return \Illuminate\Http\Response |
|
| 31 | + * @return \Illuminate\Http\JsonResponse |
|
| 32 | 32 | */ |
| 33 | 33 | public function check(Request $request, HttpValidator $httpValidator) |
| 34 | 34 | { |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | /** |
| 12 | 12 | * Return all projects. |
| 13 | 13 | * |
| 14 | - * @return \Illuminate\Http\Response |
|
| 14 | + * @return \Illuminate\Http\JsonResponse |
|
| 15 | 15 | */ |
| 16 | 16 | public function index() |
| 17 | 17 | { |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | /** |
| 55 | 55 | * Add a new project to the portfolio. |
| 56 | 56 | * |
| 57 | - * @param Larafolio\Http\Requests\AddProjectRequest $request Form request. |
|
| 57 | + * @param AddProjectRequest $request Form request. |
|
| 58 | 58 | * |
| 59 | 59 | * @return \Illuminate\Http\Response |
| 60 | 60 | */ |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | * |
| 12 | 12 | * @param array $data Array of data to save. |
| 13 | 13 | * |
| 14 | - * @return Larafolio\Models\Project |
|
| 14 | + * @return Project |
|
| 15 | 15 | */ |
| 16 | 16 | public function addProject(array $data) |
| 17 | 17 | { |
@@ -33,10 +33,10 @@ discard block |
||
| 33 | 33 | /** |
| 34 | 34 | * Update a project in the portfolio. |
| 35 | 35 | * |
| 36 | - * @param Larafolio\Models\Project $project Project to update. |
|
| 36 | + * @param Project $project Project to update. |
|
| 37 | 37 | * @param array $data Array of data to save. |
| 38 | 38 | * |
| 39 | - * @return bool |
|
| 39 | + * @return Project |
|
| 40 | 40 | */ |
| 41 | 41 | public function updateProject(Project $project, array $data) |
| 42 | 42 | { |
@@ -52,9 +52,9 @@ discard block |
||
| 52 | 52 | /** |
| 53 | 53 | * Remove a project from the portfolio. |
| 54 | 54 | * |
| 55 | - * @param Larafolio\Models\Project $project Project to remove. |
|
| 55 | + * @param Project $project Project to remove. |
|
| 56 | 56 | * |
| 57 | - * @return bool |
|
| 57 | + * @return boolean|null |
|
| 58 | 58 | */ |
| 59 | 59 | public function removeProject(Project $project) |
| 60 | 60 | { |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | /** |
| 65 | 65 | * Restore a soft deleted project. |
| 66 | 66 | * |
| 67 | - * @param Larafolio\Models\Project $project Project to restore. |
|
| 67 | + * @param Project $project Project to restore. |
|
| 68 | 68 | * |
| 69 | - * @return bool |
|
| 69 | + * @return boolean|null |
|
| 70 | 70 | */ |
| 71 | 71 | public function restoreProject(Project $project) |
| 72 | 72 | { |
@@ -78,9 +78,9 @@ discard block |
||
| 78 | 78 | /** |
| 79 | 79 | * Hard delete a project from the portfolio. |
| 80 | 80 | * |
| 81 | - * @param Larafolio\Models\Project $project Project to purge. |
|
| 81 | + * @param Project $project Project to purge. |
|
| 82 | 82 | * |
| 83 | - * @return bool |
|
| 83 | + * @return boolean|null |
|
| 84 | 84 | */ |
| 85 | 85 | public function purgeProject(Project $project) |
| 86 | 86 | { |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | * |
| 115 | 115 | * @param array $data Data array containing 'order' index. |
| 116 | 116 | * |
| 117 | - * @return Collection |
|
| 117 | + * @return \Illuminate\Support\Collection |
|
| 118 | 118 | */ |
| 119 | 119 | protected function setOrder(array $data) |
| 120 | 120 | { |
@@ -129,10 +129,10 @@ discard block |
||
| 129 | 129 | /** |
| 130 | 130 | * Add a text block to a project. |
| 131 | 131 | * |
| 132 | - * @param Larafolio\Models\Project $project Project to add text block to. |
|
| 132 | + * @param Project $project Project to add text block to. |
|
| 133 | 133 | * @param array $blockData Array of text block data. |
| 134 | 134 | * |
| 135 | - * @return Larafolio\Models\TextBlock |
|
| 135 | + * @return \Illuminate\Database\Eloquent\Model |
|
| 136 | 136 | */ |
| 137 | 137 | public function addBlockToProject(Project $project, array $blockData) |
| 138 | 138 | { |
@@ -142,10 +142,10 @@ discard block |
||
| 142 | 142 | /** |
| 143 | 143 | * Update a text block. |
| 144 | 144 | * |
| 145 | - * @param Larafolio\Models\TextBlock $textBlock Text block to update. |
|
| 145 | + * @param TextBlock $textBlock Text block to update. |
|
| 146 | 146 | * @param array $blockData Array of text block data. |
| 147 | 147 | * |
| 148 | - * @return Larafolio\Models\TextBlock |
|
| 148 | + * @return TextBlock |
|
| 149 | 149 | */ |
| 150 | 150 | public function updateTextBlock(TextBlock $textBlock, array $blockData) |
| 151 | 151 | { |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | /** |
| 158 | 158 | * Update project text blocks by adding new ones and updating existing ones. |
| 159 | 159 | * |
| 160 | - * @param Larafolio\Models\Project $project Project that blocks belong to. |
|
| 160 | + * @param Project $project Project that blocks belong to. |
|
| 161 | 161 | * @param array $data Array of project information. |
| 162 | 162 | */ |
| 163 | 163 | public function updateProjectTextBlocks(Project $project, array $data) |
@@ -180,9 +180,9 @@ discard block |
||
| 180 | 180 | /** |
| 181 | 181 | * Remove a text block from a project. |
| 182 | 182 | * |
| 183 | - * @param Larafolio\Models\TextBlock $textBlock The text block to delete. |
|
| 183 | + * @param TextBlock $textBlock The text block to delete. |
|
| 184 | 184 | * |
| 185 | - * @return bool |
|
| 185 | + * @return boolean|null |
|
| 186 | 186 | */ |
| 187 | 187 | public function removeTextBlock(TextBlock $textBlock) |
| 188 | 188 | { |
@@ -192,10 +192,10 @@ discard block |
||
| 192 | 192 | /** |
| 193 | 193 | * Add image to a project. |
| 194 | 194 | * |
| 195 | - * @param Larafolio\Models\Project $project Project to add image to. |
|
| 195 | + * @param Project $project Project to add image to. |
|
| 196 | 196 | * @param array $imageData Array of image infomation. |
| 197 | 197 | * |
| 198 | - * @return Larafolio\Models\Image |
|
| 198 | + * @return \Illuminate\Database\Eloquent\Model |
|
| 199 | 199 | */ |
| 200 | 200 | public function addImageToProject(Project $project, array $imageData) |
| 201 | 201 | { |
@@ -205,10 +205,10 @@ discard block |
||
| 205 | 205 | /** |
| 206 | 206 | * Update image name and caption. |
| 207 | 207 | * |
| 208 | - * @param Larafolio\Models\Image $image Image to update. |
|
| 208 | + * @param Image $image Image to update. |
|
| 209 | 209 | * @param array $imageData Array of inmage information. |
| 210 | 210 | * |
| 211 | - * @return Larafolio\Models\Image |
|
| 211 | + * @return Image |
|
| 212 | 212 | */ |
| 213 | 213 | public function updateImageInfo(Image $image, array $imageData) |
| 214 | 214 | { |
@@ -220,9 +220,9 @@ discard block |
||
| 220 | 220 | /** |
| 221 | 221 | * Remove image from storage and delete database info. |
| 222 | 222 | * |
| 223 | - * @param Larafolio\Models\Image $image Image to remove. |
|
| 223 | + * @param Image $image Image to remove. |
|
| 224 | 224 | * |
| 225 | - * @return bool |
|
| 225 | + * @return boolean|null |
|
| 226 | 226 | */ |
| 227 | 227 | public function removeImage(Image $image) |
| 228 | 228 | { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | /** |
| 235 | 235 | * Add a link to a project. |
| 236 | 236 | * |
| 237 | - * @param Larafolio\Models\Project $project Project to add link to. |
|
| 237 | + * @param Project $project Project to add link to. |
|
| 238 | 238 | * @param array $linkData Array of link info. |
| 239 | 239 | */ |
| 240 | 240 | public function addLinkToProject(Project $project, array $linkData) |
@@ -245,10 +245,10 @@ discard block |
||
| 245 | 245 | /** |
| 246 | 246 | * Update a link. |
| 247 | 247 | * |
| 248 | - * @param Larafolio\Models\Link $link Link to update. |
|
| 248 | + * @param Link $link Link to update. |
|
| 249 | 249 | * @param array $linkData Array of link data. |
| 250 | 250 | * |
| 251 | - * @return Larafolio\Models\Link |
|
| 251 | + * @return Link |
|
| 252 | 252 | */ |
| 253 | 253 | public function updateLink(Link $link, array $linkData) |
| 254 | 254 | { |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | /** |
| 261 | 261 | * Update project links by adding new ones and updating existing ones. |
| 262 | 262 | * |
| 263 | - * @param Larafolio\Models\Project $project Project that links belong to. |
|
| 263 | + * @param Project $project Project that links belong to. |
|
| 264 | 264 | * @param array $data Array of project information. |
| 265 | 265 | */ |
| 266 | 266 | public function updateProjectLinks(Project $project, array $data) |
@@ -283,9 +283,9 @@ discard block |
||
| 283 | 283 | /** |
| 284 | 284 | * Remove link from a project. |
| 285 | 285 | * |
| 286 | - * @param Larafolio\Models\Link $link Link to remove. |
|
| 286 | + * @param Link $link Link to remove. |
|
| 287 | 287 | * |
| 288 | - * @return bool |
|
| 288 | + * @return boolean|null |
|
| 289 | 289 | */ |
| 290 | 290 | public function removeLink(Link $link) |
| 291 | 291 | { |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | protected function setOrder(array $data) |
| 120 | 120 | { |
| 121 | 121 | return collect($data)->sortBy('order') |
| 122 | - ->map(function ($item, $key) { |
|
| 122 | + ->map(function($item, $key) { |
|
| 123 | 123 | $item['order'] = $key; |
| 124 | 124 | |
| 125 | 125 | return $item; |
@@ -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/add', 'Larafolio\Http\Controllers\ProjectController@create')->name('add-project'); |
| 5 | 5 | |
| 6 | 6 | Route::get('/manager', 'Larafolio\Http\Controllers\DashboardController@index')->name('dashboard'); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function __construct() |
| 26 | 26 | { |
| 27 | - $this->middleware(function ($request, $next) { |
|
| 27 | + $this->middleware(function($request, $next) { |
|
| 28 | 28 | $this->user = Auth::user(); |
| 29 | 29 | |
| 30 | 30 | return $next($request); |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | |
| 22 | 22 | factory(Project::class) |
| 23 | 23 | ->create(['name' => $name]) |
| 24 | - ->each(function (Project $project) { |
|
| 24 | + ->each(function(Project $project) { |
|
| 25 | 25 | $project->blocks()->save(factory(TextBlock::class)->make()); |
| 26 | 26 | |
| 27 | 27 | $project->links()->save(factory(Link::class)->make()); |
@@ -1,7 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** @var \Illuminate\Database\Eloquent\Factory $factory */ |
| 4 | -$factory->define(App\User::class, function (Faker\Generator $faker) { |
|
| 4 | +$factory->define(App\User::class, function(Faker\Generator $faker) { |
|
| 5 | 5 | static $password; |
| 6 | 6 | |
| 7 | 7 | return [ |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | ]; |
| 13 | 13 | }); |
| 14 | 14 | |
| 15 | -$factory->define(Larafolio\Models\Project::class, function () { |
|
| 15 | +$factory->define(Larafolio\Models\Project::class, function() { |
|
| 16 | 16 | $name = str_random(30); |
| 17 | 17 | |
| 18 | 18 | $types = ['web', 'github', 'volunteer']; |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | ]; |
| 28 | 28 | }); |
| 29 | 29 | |
| 30 | -$factory->define(Larafolio\Models\Image::class, function (Faker\Generator $faker) { |
|
| 30 | +$factory->define(Larafolio\Models\Image::class, function(Faker\Generator $faker) { |
|
| 31 | 31 | $project = factory(Larafolio\Models\Project::class)->create(); |
| 32 | 32 | |
| 33 | 33 | return [ |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | ]; |
| 38 | 38 | }); |
| 39 | 39 | |
| 40 | -$factory->define(Larafolio\Models\TextBlock::class, function (Faker\Generator $faker) { |
|
| 40 | +$factory->define(Larafolio\Models\TextBlock::class, function(Faker\Generator $faker) { |
|
| 41 | 41 | $text = $faker->paragraph(5, true); |
| 42 | 42 | |
| 43 | 43 | return [ |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ]; |
| 49 | 49 | }); |
| 50 | 50 | |
| 51 | -$factory->define(Larafolio\Models\Link::class, function (Faker\Generator $faker) { |
|
| 51 | +$factory->define(Larafolio\Models\Link::class, function(Faker\Generator $faker) { |
|
| 52 | 52 | return [ |
| 53 | 53 | 'name' => $faker->word, |
| 54 | 54 | 'text' => $faker->sentence, |
@@ -15,11 +15,11 @@ |
||
| 15 | 15 | { |
| 16 | 16 | $projects = Project::all()->sortBy('order')->values(); |
| 17 | 17 | |
| 18 | - $images = $projects->mapWithKeys(function (Project $project) { |
|
| 18 | + $images = $projects->mapWithKeys(function(Project $project) { |
|
| 19 | 19 | return [$project->name() => $project->getProjectImageUrl()]; |
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | - $blocks = $projects->mapWithKeys(function (Project $project) { |
|
| 22 | + $blocks = $projects->mapWithKeys(function(Project $project) { |
|
| 23 | 23 | return [$project->name() => $project->getProjectBlockText()]; |
| 24 | 24 | }); |
| 25 | 25 | |