@@ -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 | 15 | 'job_poster_id' => function () { |
16 | - return factory(JobPoster::class)->states('published')->create()->id; |
|
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'), |
|
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 | 24 | 'applicant_id' => function () { |
25 | - return factory(Applicant::class)->create()->id; |
|
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,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, |
|
11 | + 'skill_id' => Skill::inRandomOrder ()->first ()->id, |
|
12 | + 'skill_status_id' => SkillStatus::inRandomOrder ()->first ()->id, |
|
13 | + 'skill_level_id' => SkillLevel::inRandomOrder ()->first ()->id, |
|
14 | 14 | 'applicant_id' => function () { |
15 | - return factory(Applicant::class)->create()->id; |
|
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 | }); |
@@ -6,31 +6,31 @@ |
||
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 | - 'name' => $faker->name(), |
|
12 | - 'email' => $faker->safeEmail(), |
|
13 | - 'description' => $faker->paragraphs(2, true), |
|
14 | - 'relationship_id' => Relationship::inRandomOrder()->first()->id, |
|
11 | + 'name' => $faker->name (), |
|
12 | + 'email' => $faker->safeEmail (), |
|
13 | + 'description' => $faker->paragraphs (2, true), |
|
14 | + 'relationship_id' => Relationship::inRandomOrder ()->first ()->id, |
|
15 | 15 | 'applicant_id' => function () { |
16 | - return factory(Applicant::class)->create()->id; |
|
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 | - 'name' => $faker->sentence(), |
|
24 | - 'start_date' => $faker->dateTimeBetween('-3 years', '-1 years'), |
|
25 | - 'end_date' => $faker->dateTimeBetween('-1 years', '-1 day'), |
|
23 | + 'name' => $faker->sentence (), |
|
24 | + 'start_date' => $faker->dateTimeBetween ('-3 years', '-1 years'), |
|
25 | + 'end_date' => $faker->dateTimeBetween ('-1 years', '-1 day'), |
|
26 | 26 | 'applicant_id' => function () { |
27 | - return factory(Applicant::class)->create()->id; |
|
27 | + return factory (Applicant::class)->create ()->id; |
|
28 | 28 | }, |
29 | 29 | ]; |
30 | 30 | }); |
31 | 31 | |
32 | -$factory->afterCreating(Reference::class, function ($reference) : void { |
|
33 | - $reference->projects()->saveMany(factory(Project::class, 3)->make([ |
|
32 | +$factory->afterCreating (Reference::class, function ($reference) : void { |
|
33 | + $reference->projects ()->saveMany (factory (Project::class, 3)->make ([ |
|
34 | 34 | 'applicant_id' => $reference->applicant_id |
35 | 35 | ])); |
36 | 36 | }); |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @return void |
18 | 18 | */ |
19 | - public function __construct(User $user) |
|
19 | + public function __construct (User $user) |
|
20 | 20 | { |
21 | 21 | $this->user = $user; |
22 | 22 | } |
@@ -16,7 +16,7 @@ |
||
16 | 16 | * |
17 | 17 | * @return void |
18 | 18 | */ |
19 | - public function __construct(JobApplication $application) |
|
19 | + public function __construct (JobApplication $application) |
|
20 | 20 | { |
21 | 21 | $this->application = $application; |
22 | 22 | } |
@@ -53,56 +53,56 @@ |
||
53 | 53 | 'linkedin_url' |
54 | 54 | ]; |
55 | 55 | |
56 | - public function user() |
|
56 | + public function user () |
|
57 | 57 | { |
58 | - return $this->belongsTo(\App\Models\User::class); |
|
58 | + return $this->belongsTo (\App\Models\User::class); |
|
59 | 59 | } |
60 | 60 | |
61 | - public function applicant_profile_answers() |
|
61 | + public function applicant_profile_answers () |
|
62 | 62 | { |
63 | - return $this->hasMany(\App\Models\ApplicantProfileAnswer::class); |
|
63 | + return $this->hasMany (\App\Models\ApplicantProfileAnswer::class); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function job_applications() |
|
66 | + public function job_applications () |
|
67 | 67 | { |
68 | 68 | if ($this->is_snapshot) { |
69 | - return $this->hasMany(\App\Models\JobApplication::class, 'applicant_snapshot_id'); |
|
69 | + return $this->hasMany (\App\Models\JobApplication::class, 'applicant_snapshot_id'); |
|
70 | 70 | } |
71 | - return $this->hasMany(\App\Models\JobApplication::class); |
|
71 | + return $this->hasMany (\App\Models\JobApplication::class); |
|
72 | 72 | } |
73 | 73 | |
74 | - public function degrees() |
|
74 | + public function degrees () |
|
75 | 75 | { |
76 | - return $this->hasMany(\App\Models\Degree::class)->orderBy('end_date', 'desc'); |
|
76 | + return $this->hasMany (\App\Models\Degree::class)->orderBy ('end_date', 'desc'); |
|
77 | 77 | } |
78 | 78 | |
79 | - public function courses() |
|
79 | + public function courses () |
|
80 | 80 | { |
81 | - return $this->hasMany(\App\Models\Course::class)->orderBy('end_date', 'desc'); |
|
81 | + return $this->hasMany (\App\Models\Course::class)->orderBy ('end_date', 'desc'); |
|
82 | 82 | } |
83 | 83 | |
84 | - public function work_experiences() |
|
84 | + public function work_experiences () |
|
85 | 85 | { |
86 | - return $this->hasMany(\App\Models\WorkExperience::class)->orderBy('end_date', 'desc'); |
|
86 | + return $this->hasMany (\App\Models\WorkExperience::class)->orderBy ('end_date', 'desc'); |
|
87 | 87 | } |
88 | 88 | |
89 | - public function skill_declarations() |
|
89 | + public function skill_declarations () |
|
90 | 90 | { |
91 | - return $this->hasMany(\App\Models\SkillDeclaration::class); |
|
91 | + return $this->hasMany (\App\Models\SkillDeclaration::class); |
|
92 | 92 | } |
93 | 93 | |
94 | - public function references() |
|
94 | + public function references () |
|
95 | 95 | { |
96 | - return $this->hasMany(\App\Models\Reference::class); |
|
96 | + return $this->hasMany (\App\Models\Reference::class); |
|
97 | 97 | } |
98 | 98 | |
99 | - public function work_samples() |
|
99 | + public function work_samples () |
|
100 | 100 | { |
101 | - return $this->hasMany(\App\Models\WorkSample::class); |
|
101 | + return $this->hasMany (\App\Models\WorkSample::class); |
|
102 | 102 | } |
103 | 103 | |
104 | - public function projects() |
|
104 | + public function projects () |
|
105 | 105 | { |
106 | - return $this->hasMany(\App\Models\Project::class); |
|
106 | + return $this->hasMany (\App\Models\Project::class); |
|
107 | 107 | } |
108 | 108 | } |
@@ -48,33 +48,33 @@ |
||
48 | 48 | 'skill_level_id' |
49 | 49 | ]; |
50 | 50 | |
51 | - public function skill()// phpcs:ignore |
|
51 | + public function skill ()// phpcs:ignore |
|
52 | 52 | { |
53 | - return $this->belongsTo(\App\Models\Skill::class); |
|
53 | + return $this->belongsTo (\App\Models\Skill::class); |
|
54 | 54 | } |
55 | 55 | |
56 | - public function skill_status()// phpcs:ignore |
|
56 | + public function skill_status ()// phpcs:ignore |
|
57 | 57 | { |
58 | - return $this->belongsTo(\App\Models\Lookup\SkillStatus::class); |
|
58 | + return $this->belongsTo (\App\Models\Lookup\SkillStatus::class); |
|
59 | 59 | } |
60 | 60 | |
61 | - public function skill_level()// phpcs:ignore |
|
61 | + public function skill_level ()// phpcs:ignore |
|
62 | 62 | { |
63 | - return $this->belongsTo(\App\Models\Lookup\SkillLevel::class); |
|
63 | + return $this->belongsTo (\App\Models\Lookup\SkillLevel::class); |
|
64 | 64 | } |
65 | 65 | |
66 | - public function applicant()// phpcs:ignore |
|
66 | + public function applicant ()// phpcs:ignore |
|
67 | 67 | { |
68 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
68 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
69 | 69 | } |
70 | 70 | |
71 | - public function references()// phpcs:ignore |
|
71 | + public function references ()// phpcs:ignore |
|
72 | 72 | { |
73 | - return $this->belongsToMany(\App\Models\Reference::class); |
|
73 | + return $this->belongsToMany (\App\Models\Reference::class); |
|
74 | 74 | } |
75 | 75 | |
76 | - public function work_samples()// phpcs:ignore |
|
76 | + public function work_samples ()// phpcs:ignore |
|
77 | 77 | { |
78 | - return $this->belongsToMany(\App\Models\WorkSample::class); |
|
78 | + return $this->belongsToMany (\App\Models\WorkSample::class); |
|
79 | 79 | } |
80 | 80 | } |
@@ -51,13 +51,13 @@ |
||
51 | 51 | 'blockcert_url', |
52 | 52 | ]; |
53 | 53 | |
54 | - public function degree_type() |
|
54 | + public function degree_type () |
|
55 | 55 | { |
56 | - return $this->belongsTo(\App\Models\Lookup\DegreeType::class); |
|
56 | + return $this->belongsTo (\App\Models\Lookup\DegreeType::class); |
|
57 | 57 | } |
58 | 58 | |
59 | - public function applicant() |
|
59 | + public function applicant () |
|
60 | 60 | { |
61 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
61 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
62 | 62 | } |
63 | 63 | } |
@@ -42,8 +42,8 @@ |
||
42 | 42 | 'end_date' |
43 | 43 | ]; |
44 | 44 | |
45 | - public function applicant() |
|
45 | + public function applicant () |
|
46 | 46 | { |
47 | - return $this->belongsTo(\App\Models\Applicant::class); |
|
47 | + return $this->belongsTo (\App\Models\Applicant::class); |
|
48 | 48 | } |
49 | 49 | } |