@@ -6,16 +6,16 @@ |
||
6 | 6 | use App\Models\RatingGuideQuestion; |
7 | 7 | use App\Models\RatingGuideAnswer; |
8 | 8 | |
9 | -$factory->define(Assessment::class, function (Faker\Generator $faker) { |
|
9 | +$factory->define(Assessment::class, function(Faker\Generator $faker){ |
|
10 | 10 | return [ |
11 | - 'criterion_id' => function () { |
|
11 | + 'criterion_id' => function(){ |
|
12 | 12 | return factory(Criteria::class)->create()->id; |
13 | 13 | }, |
14 | 14 | 'assessment_type_id' => AssessmentType::inRandomOrder()->first()->id, |
15 | 15 | ]; |
16 | 16 | }); |
17 | 17 | |
18 | -$factory->afterMakingState(Assessment::class, 'withRatingGuide', function ($assessment, $faker): void { |
|
18 | +$factory->afterMakingState(Assessment::class, 'withRatingGuide', function($assessment, $faker): void { |
|
19 | 19 | // Create a RatingGuideQuestion, and an accompanying RatingGuideAnswer |
20 | 20 | $question = factory(RatingGuideQuestion::class)->create([ |
21 | 21 | 'job_poster_id' => $assessment->criterion->job_poster_id, |
@@ -5,12 +5,12 @@ |
||
5 | 5 | use App\Models\JobApplication; |
6 | 6 | use App\Models\JobApplicationAnswer; |
7 | 7 | |
8 | -$factory->define(JobApplicationAnswer::class, function (Faker\Generator $faker) { |
|
8 | +$factory->define(JobApplicationAnswer::class, function(Faker\Generator $faker){ |
|
9 | 9 | return [ |
10 | - 'job_poster_question_id' => function () { |
|
10 | + 'job_poster_question_id' => function(){ |
|
11 | 11 | return factory(JobPosterQuestion::class)->create()->id; |
12 | 12 | }, |
13 | - 'job_application_id' => function () { |
|
13 | + 'job_application_id' => function(){ |
|
14 | 14 | return factory(JobApplication::class)->create()->id; |
15 | 15 | }, |
16 | 16 | 'answer' => $faker->paragraph() |
@@ -6,30 +6,30 @@ |
||
6 | 6 | use App\Models\Applicant; |
7 | 7 | use App\Models\Project; |
8 | 8 | |
9 | -$factory->define(Reference::class, function (Faker $faker) { |
|
9 | +$factory->define(Reference::class, function(Faker $faker){ |
|
10 | 10 | return [ |
11 | 11 | 'name' => $faker->name(), |
12 | 12 | 'email' => $faker->safeEmail(), |
13 | 13 | 'description' => $faker->paragraphs(2, true), |
14 | 14 | 'relationship_id' => Relationship::inRandomOrder()->first()->id, |
15 | - 'applicant_id' => function () { |
|
15 | + 'applicant_id' => function(){ |
|
16 | 16 | return factory(Applicant::class)->create()->id; |
17 | 17 | }, |
18 | 18 | ]; |
19 | 19 | }); |
20 | 20 | |
21 | -$factory->define(Project::class, function (Faker $faker) { |
|
21 | +$factory->define(Project::class, function(Faker $faker){ |
|
22 | 22 | return [ |
23 | 23 | 'name' => $faker->sentence(), |
24 | 24 | 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
25 | 25 | 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
26 | - 'applicant_id' => function () { |
|
26 | + 'applicant_id' => function(){ |
|
27 | 27 | return factory(Applicant::class)->create()->id; |
28 | 28 | }, |
29 | 29 | ]; |
30 | 30 | }); |
31 | 31 | |
32 | -$factory->afterCreating(Reference::class, function ($reference) : void { |
|
32 | +$factory->afterCreating(Reference::class, function($reference) : void { |
|
33 | 33 | $reference->projects()->saveMany(factory(Project::class, 3)->make([ |
34 | 34 | 'applicant_id' => $reference->applicant_id |
35 | 35 | ])); |
@@ -5,9 +5,9 @@ |
||
5 | 5 | use App\Models\Skill; |
6 | 6 | use App\Models\Criteria; |
7 | 7 | |
8 | -$factory->define(RatingGuideAnswer::class, function (Faker\Generator $faker) { |
|
8 | +$factory->define(RatingGuideAnswer::class, function(Faker\Generator $faker){ |
|
9 | 9 | return [ |
10 | - 'rating_guide_question_id' => function () { |
|
10 | + 'rating_guide_question_id' => function(){ |
|
11 | 11 | return factory(RatingGuideQuestion::class)->create()->id; |
12 | 12 | }, |
13 | 13 | 'criterion_id' => null, |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | factory(JobPoster::class, 3)->state('published')->create([ |
62 | 62 | 'manager_id' => $managerUser->manager->id |
63 | - ])->each(function ($job) : void { |
|
63 | + ])->each(function($job) : void { |
|
64 | 64 | $job->job_applications()->saveMany(factory(JobApplication::class, 5))->create([ |
65 | 65 | 'job_poster_id' => $job->id |
66 | 66 | ]); |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | }); |
75 | 75 | factory(JobPoster::class, 3)->state('closed')->create([ |
76 | 76 | 'manager_id' => $managerUser->manager->id |
77 | - ])->each(function ($job) : void { |
|
77 | + ])->each(function($job) : void { |
|
78 | 78 | $job->job_applications()->saveMany(factory(JobApplication::class, 5))->create([ |
79 | 79 | 'job_poster_id' => $job->id |
80 | 80 | ]); |
@@ -9,7 +9,7 @@ |
||
9 | 9 | 'prefix' => config('backpack.base.route_prefix', 'admin'), |
10 | 10 | 'middleware' => ['web', config('backpack.base.middleware_key', 'admin')], |
11 | 11 | 'namespace' => 'App\Http\Controllers\Admin', |
12 | -], function () : void { |
|
12 | +], function() : void { |
|
13 | 13 | // Custom admin routes. |
14 | 14 | Route::crud('skill', 'SkillCrudController'); |
15 | 15 | Route::crud('job-poster', 'JobPosterCrudController'); |
@@ -480,7 +480,7 @@ |
||
480 | 480 | ->middleware('can:update,jobPoster'); |
481 | 481 | |
482 | 482 | |
483 | - Route::get('jobs/{jobPoster}/criteria', 'Api\CriteriaController@indexByJob') |
|
483 | + Route::get('jobs/{jobPoster}/criteria', 'Api\CriteriaController@indexByJob') |
|
484 | 484 | ->where('jobPoster', '[0-9]+') |
485 | 485 | ->middleware('can:view,jobPoster'); |
486 | 486 | Route::put('jobs/{jobPoster}/criteria', 'Api\CriteriaController@batchUpdate') |
@@ -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 | ]); |
@@ -8,10 +8,10 @@ |
||
8 | 8 | |
9 | 9 | $faker_fr = Faker\Factory::create('fr'); |
10 | 10 | |
11 | -$factory->define(Criteria::class, function (Faker\Generator $faker) use ($faker_fr) { |
|
11 | +$factory->define(Criteria::class, function(Faker\Generator $faker) use ($faker_fr) { |
|
12 | 12 | return [ |
13 | 13 | 'criteria_type_id' => CriteriaType::inRandomOrder()->first()->id, |
14 | - 'job_poster_id' => function () { |
|
14 | + 'job_poster_id' => function(){ |
|
15 | 15 | return factory(JobPoster::class)->create()->id; |
16 | 16 | }, |
17 | 17 | 'skill_id' => Skill::inRandomOrder()->first()->id, |
@@ -6,14 +6,14 @@ |
||
6 | 6 | use App\Models\Manager; |
7 | 7 | use App\Models\Lookup\Frequency; |
8 | 8 | |
9 | -$factory->define(WorkEnvironment::class, function (Faker $faker) { |
|
9 | +$factory->define(WorkEnvironment::class, function(Faker $faker){ |
|
10 | 10 | $faker_fr = FakerFactory::create('fr'); |
11 | 11 | return [ |
12 | 12 | 'telework_allowed_frequency_id' => Frequency::inRandomOrder()->first()->id, |
13 | 13 | 'flexible_hours_frequency_id' => Frequency::inRandomOrder()->first()->id, |
14 | 14 | 'things_to_know:en' => $faker->paragraph(), |
15 | 15 | 'things_to_know:fr' => $faker_fr->paragraph(), |
16 | - 'manager_id' => function () { |
|
16 | + 'manager_id' => function(){ |
|
17 | 17 | return factory(Manager::class)->create()->id; |
18 | 18 | } |
19 | 19 | ]; |