@@ -5,12 +5,12 @@ |
||
5 | 5 | use App\Models\RatingGuideQuestion; |
6 | 6 | use App\Models\JobPoster; |
7 | 7 | |
8 | -$factory->define(RatingGuideQuestion::class, function (Faker\Generator $faker) { |
|
8 | +$factory->define (RatingGuideQuestion::class, function (Faker\Generator $faker){ |
|
9 | 9 | return [ |
10 | - 'job_poster_id' => function () { |
|
11 | - return factory(JobPoster::class)->create()->id; |
|
10 | + 'job_poster_id' => function (){ |
|
11 | + return factory (JobPoster::class)->create ()->id; |
|
12 | 12 | }, |
13 | - 'assessment_type_id' => AssessmentType::inRandomOrder()->first()->id, |
|
14 | - 'question' => $faker->sentence(), |
|
13 | + 'assessment_type_id' => AssessmentType::inRandomOrder ()->first ()->id, |
|
14 | + 'question' => $faker->sentence (), |
|
15 | 15 | ]; |
16 | 16 | }); |
@@ -5,12 +5,12 @@ |
||
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 () { |
|
11 | - return factory(RatingGuideQuestion::class)->create()->id; |
|
10 | + 'rating_guide_question_id' => function (){ |
|
11 | + return factory (RatingGuideQuestion::class)->create ()->id; |
|
12 | 12 | }, |
13 | 13 | 'criterion_id' => null, |
14 | - 'expected_answer' => $faker->sentence(), |
|
14 | + 'expected_answer' => $faker->sentence (), |
|
15 | 15 | ]; |
16 | 16 | }); |
@@ -5,14 +5,14 @@ |
||
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 () { |
|
11 | - return factory(JobPosterQuestion::class)->create()->id; |
|
10 | + 'job_poster_question_id' => function (){ |
|
11 | + return factory (JobPosterQuestion::class)->create ()->id; |
|
12 | 12 | }, |
13 | - 'job_application_id' => function () { |
|
14 | - return factory(JobApplication::class)->create()->id; |
|
13 | + 'job_application_id' => function (){ |
|
14 | + return factory (JobApplication::class)->create ()->id; |
|
15 | 15 | }, |
16 | - 'answer' => $faker->paragraph() |
|
16 | + 'answer' => $faker->paragraph () |
|
17 | 17 | ]; |
18 | 18 | }); |
@@ -6,14 +6,14 @@ |
||
6 | 6 | use App\Models\Lookup\SkillLevel; |
7 | 7 | use App\Models\Applicant; |
8 | 8 | |
9 | -$factory->define(SkillDeclaration::class, function (Faker\Generator $faker) { |
|
9 | +$factory->define (SkillDeclaration::class, function (Faker\Generator $faker){ |
|
10 | 10 | return [ |
11 | - 'skill_id' => Skill::inRandomOrder()->first()->id, |
|
12 | - 'skill_status_id' => SkillStatus::inRandomOrder()->first()->id, |
|
13 | - 'skill_level_id' => SkillLevel::inRandomOrder()->first()->id, |
|
14 | - 'applicant_id' => function () { |
|
15 | - return factory(Applicant::class)->create()->id; |
|
11 | + 'skill_id' => Skill::inRandomOrder ()->first ()->id, |
|
12 | + 'skill_status_id' => SkillStatus::inRandomOrder ()->first ()->id, |
|
13 | + 'skill_level_id' => SkillLevel::inRandomOrder ()->first ()->id, |
|
14 | + 'applicant_id' => function (){ |
|
15 | + return factory (Applicant::class)->create ()->id; |
|
16 | 16 | }, |
17 | - 'description' => $faker->paragraphs(3, true), |
|
17 | + 'description' => $faker->paragraphs (3, true), |
|
18 | 18 | ]; |
19 | 19 | }); |
@@ -10,39 +10,39 @@ |
||
10 | 10 | use App\Models\JobApplicationAnswer; |
11 | 11 | use App\Models\SkillDeclaration; |
12 | 12 | |
13 | -$factory->define(JobApplication::class, function (Faker\Generator $faker) { |
|
13 | +$factory->define (JobApplication::class, function (Faker\Generator $faker){ |
|
14 | 14 | return [ |
15 | - 'job_poster_id' => function () { |
|
16 | - return factory(JobPoster::class)->states('published')->create()->id; |
|
15 | + 'job_poster_id' => function (){ |
|
16 | + return factory (JobPoster::class)->states ('published')->create ()->id; |
|
17 | 17 | }, |
18 | - 'application_status_id' => ApplicationStatus::where('name', 'submitted')->firstOrFail()->id, |
|
19 | - 'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder()->first()->id, |
|
20 | - 'veteran_status_id' => VeteranStatus::inRandomOrder()->first()->id, |
|
21 | - 'preferred_language_id' => PreferredLanguage::inRandomOrder()->first()->id, |
|
22 | - 'submission_signature' => $faker->name(), |
|
23 | - 'submission_date' => $faker->dateTimeBetween('yesterday', 'tomorrow')->format('Y-m-d H:i:s'), |
|
24 | - 'applicant_id' => function () { |
|
25 | - return factory(Applicant::class)->create()->id; |
|
18 | + 'application_status_id' => ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id, |
|
19 | + 'citizenship_declaration_id' => CitizenshipDeclaration::inRandomOrder ()->first ()->id, |
|
20 | + 'veteran_status_id' => VeteranStatus::inRandomOrder ()->first ()->id, |
|
21 | + 'preferred_language_id' => PreferredLanguage::inRandomOrder ()->first ()->id, |
|
22 | + 'submission_signature' => $faker->name (), |
|
23 | + 'submission_date' => $faker->dateTimeBetween ('yesterday', 'tomorrow')->format ('Y-m-d H:i:s'), |
|
24 | + 'applicant_id' => function (){ |
|
25 | + return factory (Applicant::class)->create ()->id; |
|
26 | 26 | } |
27 | 27 | ]; |
28 | 28 | }); |
29 | 29 | |
30 | -$factory->state(JobApplication::class, 'draft', [ |
|
31 | - 'application_status_id' => ApplicationStatus::where('name', 'draft')->firstOrFail()->id, |
|
30 | +$factory->state (JobApplication::class, 'draft', [ |
|
31 | + 'application_status_id' => ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id, |
|
32 | 32 | 'submission_signature' => null, |
33 | 33 | 'submission_date' => null |
34 | 34 | ]); |
35 | 35 | |
36 | -$factory->afterCreating(JobApplication::class, function ($application) : void { |
|
36 | +$factory->afterCreating (JobApplication::class, function ($application) : void { |
|
37 | 37 | foreach ($application->job_poster->job_poster_questions as $question) { |
38 | - $answer = factory(JobApplicationAnswer::class)->create([ |
|
38 | + $answer = factory (JobApplicationAnswer::class)->create ([ |
|
39 | 39 | 'job_poster_question_id' => $question->id, |
40 | 40 | 'job_application_id' => $application->id |
41 | 41 | ]); |
42 | - $application->job_application_answers()->save($answer); |
|
42 | + $application->job_application_answers ()->save ($answer); |
|
43 | 43 | } |
44 | 44 | foreach ($application->job_poster->criteria as $criterion) { |
45 | - factory(SkillDeclaration::class)->create([ |
|
45 | + factory (SkillDeclaration::class)->create ([ |
|
46 | 46 | 'skill_id' => $criterion->skill_id, |
47 | 47 | 'applicant_id' => $application->applicant_id, |
48 | 48 | ]); |
@@ -6,22 +6,22 @@ |
||
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 () { |
|
12 | - return factory(Criteria::class)->create()->id; |
|
11 | + 'criterion_id' => function (){ |
|
12 | + return factory (Criteria::class)->create ()->id; |
|
13 | 13 | }, |
14 | - 'assessment_type_id' => AssessmentType::inRandomOrder()->first()->id, |
|
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 | - $question = factory(RatingGuideQuestion::class)->create([ |
|
20 | + $question = factory (RatingGuideQuestion::class)->create ([ |
|
21 | 21 | 'job_poster_id' => $assessment->criterion->job_poster_id, |
22 | 22 | 'assessment_type_id' => $assessment->assessment_type_id, |
23 | 23 | ]); |
24 | - factory(RatingGuideAnswer::class)->create([ |
|
24 | + factory (RatingGuideAnswer::class)->create ([ |
|
25 | 25 | 'rating_guide_question_id' => $question->id, |
26 | 26 | 'criterion_id' => $assessment->criterion_id, |
27 | 27 | ]); |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | * |
21 | 21 | * @property \App\Models\JobPosterQuestion $job_poster_question |
22 | 22 | */ |
23 | -class JobPosterQuestionTranslation extends BaseModel { |
|
23 | +class JobPosterQuestionTranslation extends BaseModel{ |
|
24 | 24 | |
25 | 25 | protected $casts = [ |
26 | 26 | 'job_poster_question_id' => 'int' |
@@ -30,8 +30,8 @@ discard block |
||
30 | 30 | 'description' |
31 | 31 | ]; |
32 | 32 | |
33 | - public function job_poster_question() { |
|
34 | - return $this->belongsTo(\App\Models\JobPosterQuestion::class); |
|
33 | + public function job_poster_question(){ |
|
34 | + return $this->belongsTo (\App\Models\JobPosterQuestion::class); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | } |
@@ -47,11 +47,11 @@ |
||
47 | 47 | |
48 | 48 | public function manager() |
49 | 49 | { |
50 | - return $this->belongsTo(\App\Models\Manager::class); |
|
50 | + return $this->belongsTo (\App\Models\Manager::class); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function team_culture_translations() //phpcs:ignore |
54 | 54 | { |
55 | - return $this->hasMany(\App\Models\TeamCultureTranslation::class); |
|
55 | + return $this->hasMany (\App\Models\TeamCultureTranslation::class); |
|
56 | 56 | } |
57 | 57 | } |
@@ -65,27 +65,27 @@ discard block |
||
65 | 65 | |
66 | 66 | public function criteria_type() //phpcs:ignore |
67 | 67 | { |
68 | - return $this->belongsTo(\App\Models\Lookup\CriteriaType::class); |
|
68 | + return $this->belongsTo (\App\Models\Lookup\CriteriaType::class); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | public function job_poster() //phpcs:ignore |
72 | 72 | { |
73 | - return $this->belongsTo(\App\Models\JobPoster::class); |
|
73 | + return $this->belongsTo (\App\Models\JobPoster::class); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | public function skill() |
77 | 77 | { |
78 | - return $this->belongsTo(\App\Models\Skill::class); |
|
78 | + return $this->belongsTo (\App\Models\Skill::class); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | public function skill_level() //phpcs:ignore |
82 | 82 | { |
83 | - return $this->belongsTo(\App\Models\Lookup\SkillLevel::class); |
|
83 | + return $this->belongsTo (\App\Models\Lookup\SkillLevel::class); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | public function criteria_translations() //phpcs:ignore |
87 | 87 | { |
88 | - return $this->hasMany(\App\Models\Lookup\CriteriaTypeTranslation::class); |
|
88 | + return $this->hasMany (\App\Models\Lookup\CriteriaTypeTranslation::class); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function assessments() // phpcs:ignore |
97 | 97 | { |
98 | - return $this->hasMany(\App\Models\Assessment::class, 'criterion_id'); |
|
98 | + return $this->hasMany (\App\Models\Assessment::class, 'criterion_id'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | { |
108 | 108 | $level = $this->skill_level->name; |
109 | 109 | $type = $this->skill->skill_type->name; |
110 | - return Lang::get("common/lookup/skill_level.$level.$type.name"); |
|
110 | + return Lang::get ("common/lookup/skill_level.$level.$type.name"); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -119,6 +119,6 @@ discard block |
||
119 | 119 | { |
120 | 120 | $level = $this->skill_level->name; |
121 | 121 | $type = $this->skill->skill_type->name; |
122 | - return Lang::get("common/lookup/skill_level.$level.$type.description"); |
|
122 | + return Lang::get ("common/lookup/skill_level.$level.$type.description"); |
|
123 | 123 | } |
124 | 124 | } |