@@ -25,7 +25,7 @@ |
||
| 25 | 25 | public function rules() : array |
| 26 | 26 | { |
| 27 | 27 | return [ |
| 28 | - 'name' => 'required|unique_translation:skills,name' . (isset($this->id) ? ",{$this->id}" : ''), |
|
| 28 | + 'name' => 'required|unique_translation:skills,name'.(isset($this->id) ? ",{$this->id}" : ''), |
|
| 29 | 29 | 'description' => 'required', |
| 30 | 30 | 'skill_type_id' => 'exists:skill_types,id' |
| 31 | 31 | ]; |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | $validator->validate($request->all()); |
| 133 | 133 | |
| 134 | 134 | foreach ($questions as $question) { |
| 135 | - $answerName = $this->answerFormInputName . '.' . $question->id; |
|
| 135 | + $answerName = $this->answerFormInputName.'.'.$question->id; |
|
| 136 | 136 | if ($request->has($answerName)) { |
| 137 | 137 | $answer = ApplicantProfileAnswer::where( |
| 138 | 138 | [ |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | )->first(); |
| 143 | 143 | if ($answer == null) { |
| 144 | 144 | $answer = new ApplicantProfileAnswer(); |
| 145 | - $answer->applicant_id =$applicant->id; |
|
| 145 | + $answer->applicant_id = $applicant->id; |
|
| 146 | 146 | $answer->applicant_profile_question_id = $question->id; |
| 147 | 147 | } |
| 148 | 148 | $answer->answer = $request->input($answerName); |
@@ -41,11 +41,11 @@ |
||
| 41 | 41 | $type = Relation::getMorphedModel($type); |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | - if (! class_exists($type)) { |
|
| 44 | + if (!class_exists($type)) { |
|
| 45 | 45 | return false; |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | - return ! empty(resolve($type)->find($value)); |
|
| 48 | + return !empty(resolve($type)->find($value)); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | /** |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function passes($attribute, $value) |
| 25 | 25 | { |
| 26 | - return preg_match('/' . self::PATTERN . '/', $value); |
|
| 26 | + return preg_match('/'.self::PATTERN.'/', $value); |
|
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /** |
@@ -78,7 +78,7 @@ |
||
| 78 | 78 | { |
| 79 | 79 | // prepend the attribute name of each validator rule with the nested attribute name |
| 80 | 80 | $newRules = $this->arrayMapKeys( |
| 81 | - function ($key) use ($nestedAttribute) { |
|
| 81 | + function($key) use ($nestedAttribute) { |
|
| 82 | 82 | return implode('.', [$nestedAttribute, $key]); |
| 83 | 83 | }, |
| 84 | 84 | $validatorRules |
@@ -18,10 +18,10 @@ discard block |
||
| 18 | 18 | 'prefix' => LaravelLocalization::setLocale(), |
| 19 | 19 | 'middleware' => ['localeSessionRedirect', 'localizationRedirect', 'localeViewPath'] |
| 20 | 20 | ], |
| 21 | - function (): void { |
|
| 21 | + function(): void { |
|
| 22 | 22 | /** ADD ALL LOCALIZED ROUTES INSIDE THIS GROUP **/ |
| 23 | 23 | |
| 24 | - Route::group(['prefix' => 'demo'], function (): void { |
|
| 24 | + Route::group(['prefix' => 'demo'], function(): void { |
|
| 25 | 25 | |
| 26 | 26 | /* Temporary Blog Index */ |
| 27 | 27 | Route::view('blog', 'common/blog-index')->middleware('localOnly')->name('blog'); |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | }); |
| 52 | 52 | |
| 53 | 53 | |
| 54 | - Route::group(['prefix' => config('app.applicant_prefix')], function (): void { |
|
| 54 | + Route::group(['prefix' => config('app.applicant_prefix')], function(): void { |
|
| 55 | 55 | |
| 56 | 56 | /* Home */ |
| 57 | 57 | Route::get('/', 'HomepageController@applicant')->name('home'); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | ->name('jobs.show'); |
| 65 | 65 | |
| 66 | 66 | /* Require being logged in */ |
| 67 | - Route::middleware(['auth'])->group(function (): void { |
|
| 67 | + Route::middleware(['auth'])->group(function(): void { |
|
| 68 | 68 | /* Managers */ |
| 69 | 69 | Route::get('managers/{manager}', 'ManagerProfileController@show') |
| 70 | 70 | ->middleware('can:view,manager') |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | }); |
| 73 | 73 | |
| 74 | 74 | /* Require being logged in as applicant */ |
| 75 | - Route::middleware(['auth', 'role:applicant'])->group(function (): void { |
|
| 75 | + Route::middleware(['auth', 'role:applicant'])->group(function(): void { |
|
| 76 | 76 | |
| 77 | 77 | // Application permissions are handled within the controller instead of with middleware |
| 78 | 78 | /* Applications */ |
@@ -207,9 +207,9 @@ discard block |
||
| 207 | 207 | |
| 208 | 208 | Route::group([ |
| 209 | 209 | 'prefix' => config('app.manager_prefix'), |
| 210 | - ], function (): void { |
|
| 210 | + ], function(): void { |
|
| 211 | 211 | |
| 212 | - Route::middleware(['finishManagerRegistration'])->group(function (): void { |
|
| 212 | + Route::middleware(['finishManagerRegistration'])->group(function(): void { |
|
| 213 | 213 | |
| 214 | 214 | /* Home */ |
| 215 | 215 | Route::get('/', 'HomepageController@manager')->name('manager.home'); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | 'ManagerProfileController@faq' |
| 226 | 226 | )->name('manager.faq.section'); |
| 227 | 227 | |
| 228 | - Route::middleware(['auth', 'role:manager'])->group(function (): void { |
|
| 228 | + Route::middleware(['auth', 'role:manager'])->group(function(): void { |
|
| 229 | 229 | |
| 230 | 230 | Route::get('profile', 'ManagerProfileController@editAuthenticated')->name('manager.profile'); |
| 231 | 231 | |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | }); |
| 323 | 323 | |
| 324 | 324 | // These routes must be excluded from the finishManagerRegistration middleware to avoid an infinite loop of redirects |
| 325 | - Route::middleware(['auth', 'role:manager'])->group(function (): void { |
|
| 325 | + Route::middleware(['auth', 'role:manager'])->group(function(): void { |
|
| 326 | 326 | Route::get('first-visit', 'Auth\FirstVisitController@showFirstVisitManagerForm') |
| 327 | 327 | ->name('manager.first_visit'); |
| 328 | 328 | Route::post('finish_registration', 'Auth\FirstVisitController@finishManagerRegistration') |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | /* AJAX calls =============================================================== */ |
| 349 | 349 | |
| 350 | 350 | /* Require being logged in */ |
| 351 | - Route::middleware(['auth'])->group(function (): void { |
|
| 351 | + Route::middleware(['auth'])->group(function(): void { |
|
| 352 | 352 | |
| 353 | 353 | Route::delete('courses/{course}', 'CourseController@destroy') |
| 354 | 354 | ->middleware('can:delete,course') |
@@ -414,7 +414,7 @@ discard block |
||
| 414 | 414 | 'prefix' => 'admin', |
| 415 | 415 | 'middleware' => ['auth', 'role:admin'] |
| 416 | 416 | ], |
| 417 | - function (): void { |
|
| 417 | + function(): void { |
|
| 418 | 418 | /* Edit Job */ |
| 419 | 419 | Route::get('jobs/{jobPoster}/edit', 'JobController@edit') |
| 420 | 420 | ->where('jobPoster', '[0-9]+') |
@@ -435,7 +435,7 @@ discard block |
||
| 435 | 435 | 'prefix' => 'admin', |
| 436 | 436 | 'middleware' => ['auth', 'role:admin'] |
| 437 | 437 | ], |
| 438 | - function (): void { |
|
| 438 | + function(): void { |
|
| 439 | 439 | // This page is non-localized, because the middleware that redirects to localized pages changes POSTs to GETs and messes up the request. |
| 440 | 440 | Route::post('jobs/create/as-manager/{manager}', 'JobController@createAsManager') |
| 441 | 441 | ->middleware('can:create,App\Models\JobPoster') |
@@ -449,7 +449,7 @@ discard block |
||
| 449 | 449 | |
| 450 | 450 | |
| 451 | 451 | /** API routes - currently using same default http auth, but not localized */ |
| 452 | -Route::group(['prefix' => 'api'], function (): void { |
|
| 452 | +Route::group(['prefix' => 'api'], function(): void { |
|
| 453 | 453 | // Protected by a gate in the controller, instead of policy middleware |
| 454 | 454 | Route::get('jobs/{jobPoster}/assessment-plan', 'AssessmentPlanController@getForJob'); |
| 455 | 455 | // Public, not protected by policy or gate |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | ->name('api.jobs.submit'); |
| 495 | 495 | Route::resource('jobs', 'Api\JobApiController')->only([ |
| 496 | 496 | 'show', 'store', 'update' |
| 497 | - ])->names([ // Specify custom names because default names collied with existing routes. |
|
| 497 | + ])->names([// Specify custom names because default names collied with existing routes. |
|
| 498 | 498 | 'show' => 'api.jobs.show', |
| 499 | 499 | 'store' => 'api.jobs.store', |
| 500 | 500 | 'update' => 'api.jobs.update' |
@@ -502,7 +502,7 @@ discard block |
||
| 502 | 502 | |
| 503 | 503 | Route::resource('managers', 'Api\ManagerApiController')->only([ |
| 504 | 504 | 'show', 'update' |
| 505 | - ])->names([ // Specify custom names because default names collied with existing routes |
|
| 505 | + ])->names([// Specify custom names because default names collied with existing routes |
|
| 506 | 506 | 'show' => 'api.managers.show', |
| 507 | 507 | 'update' => 'api.managers.update' |
| 508 | 508 | ]); |
@@ -65,7 +65,7 @@ |
||
| 65 | 65 | */ |
| 66 | 66 | protected function defineGates(): void |
| 67 | 67 | { |
| 68 | - Gate::define('view-assessment-plan', function ($user, $jobPoster) { |
|
| 68 | + Gate::define('view-assessment-plan', function($user, $jobPoster) { |
|
| 69 | 69 | return $user->isAdmin() || |
| 70 | 70 | $user->isManager() && $jobPoster->manager->user_id === $user->id; |
| 71 | 71 | }); |
@@ -30,7 +30,7 @@ |
||
| 30 | 30 | */ |
| 31 | 31 | public function register() |
| 32 | 32 | { |
| 33 | - $this->app->singleton(WhichPortal::class, function ($app) { |
|
| 33 | + $this->app->singleton(WhichPortal::class, function($app) { |
|
| 34 | 34 | return new WhichPortal(); |
| 35 | 35 | }); |
| 36 | 36 | } |
@@ -126,12 +126,12 @@ |
||
| 126 | 126 | // TODO: replace route('manager.show',manager.id) in templates with link using slug. |
| 127 | 127 | $criteria = [ |
| 128 | 128 | 'essential' => $jobPoster->criteria->filter( |
| 129 | - function ($value, $key) { |
|
| 129 | + function($value, $key) { |
|
| 130 | 130 | return $value->criteria_type->name == 'essential'; |
| 131 | 131 | } |
| 132 | 132 | ), |
| 133 | 133 | 'asset' => $jobPoster->criteria->filter( |
| 134 | - function ($value, $key) { |
|
| 134 | + function($value, $key) { |
|
| 135 | 135 | return $value->criteria_type->name == 'asset'; |
| 136 | 136 | } |
| 137 | 137 | ), |