@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param \App\Models\WorkExperience $workExperience |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function view(User $user, WorkExperience $workExperience) |
|
19 | + public function view (User $user, WorkExperience $workExperience) |
|
20 | 20 | { |
21 | - return $user->isApplicant() && $workExperience->applicant->user->is($user); |
|
21 | + return $user->isApplicant () && $workExperience->applicant->user->is ($user); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @param \App\Models\User $user |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | - public function create(User $user) |
|
30 | + public function create (User $user) |
|
31 | 31 | { |
32 | - return $user->isApplicant(); |
|
32 | + return $user->isApplicant (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param \App\Models\WorkExperience $workExperience |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function update(User $user, WorkExperience $workExperience) |
|
42 | + public function update (User $user, WorkExperience $workExperience) |
|
43 | 43 | { |
44 | - return $user->isApplicant() && $workExperience->applicant->user->is($user); |
|
44 | + return $user->isApplicant () && $workExperience->applicant->user->is ($user); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * @param \App\Models\WorkExperience $workExperience |
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | - public function delete(User $user, WorkExperience $workExperience) |
|
54 | + public function delete (User $user, WorkExperience $workExperience) |
|
55 | 55 | { |
56 | - return $user->isApplicant() && $workExperience->applicant->user->is($user); |
|
56 | + return $user->isApplicant () && $workExperience->applicant->user->is ($user); |
|
57 | 57 | } |
58 | 58 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param \App\Models\Reference $reference |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function view(User $user, Reference $reference) |
|
19 | + public function view (User $user, Reference $reference) |
|
20 | 20 | { |
21 | - return $user->isApplicant() && $reference->applicant->user->is($user); |
|
21 | + return $user->isApplicant () && $reference->applicant->user->is ($user); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @param \App\Models\User $user |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | - public function create(User $user) |
|
30 | + public function create (User $user) |
|
31 | 31 | { |
32 | - return $user->isApplicant(); |
|
32 | + return $user->isApplicant (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param \App\Models\Reference $reference |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function update(User $user, Reference $reference) |
|
42 | + public function update (User $user, Reference $reference) |
|
43 | 43 | { |
44 | - return $user->isApplicant() && $reference->applicant->user->is($user); |
|
44 | + return $user->isApplicant () && $reference->applicant->user->is ($user); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * @param \App\Models\Reference $reference |
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | - public function delete(User $user, Reference $reference) |
|
54 | + public function delete (User $user, Reference $reference) |
|
55 | 55 | { |
56 | - return $user->isApplicant() && $reference->applicant->user->is($user); |
|
56 | + return $user->isApplicant () && $reference->applicant->user->is ($user); |
|
57 | 57 | } |
58 | 58 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param \App\Models\SkillDeclaration $skillDeclaration |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function view(User $user, SkillDeclaration $skillDeclaration) |
|
19 | + public function view (User $user, SkillDeclaration $skillDeclaration) |
|
20 | 20 | { |
21 | - return ($user->isApplicant() && $skillDeclaration->applicant->user->is($user)); |
|
21 | + return ($user->isApplicant () && $skillDeclaration->applicant->user->is ($user)); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @param \App\Models\User $user |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | - public function create(User $user) |
|
30 | + public function create (User $user) |
|
31 | 31 | { |
32 | - return $user->isApplicant(); |
|
32 | + return $user->isApplicant (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param \App\Models\SkillDeclaration $skillDeclaration |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function update(User $user, SkillDeclaration $skillDeclaration) |
|
42 | + public function update (User $user, SkillDeclaration $skillDeclaration) |
|
43 | 43 | { |
44 | - return ($user->isApplicant() && $skillDeclaration->applicant->user->is($user)); |
|
44 | + return ($user->isApplicant () && $skillDeclaration->applicant->user->is ($user)); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * @param \App\Models\SkillDeclaration $skillDeclaration |
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | - public function delete(User $user, SkillDeclaration $skillDeclaration) |
|
54 | + public function delete (User $user, SkillDeclaration $skillDeclaration) |
|
55 | 55 | { |
56 | - return ($user->isApplicant() && $skillDeclaration->applicant->user->is($user)); |
|
56 | + return ($user->isApplicant () && $skillDeclaration->applicant->user->is ($user)); |
|
57 | 57 | } |
58 | 58 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param \App\Models\WorkSample $workSample |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function view(User $user, WorkSample $workSample) |
|
19 | + public function view (User $user, WorkSample $workSample) |
|
20 | 20 | { |
21 | - return $user->isApplicant() && $workSample->applicant->user->is($user); |
|
21 | + return $user->isApplicant () && $workSample->applicant->user->is ($user); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @param \App\Models\User $user |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | - public function create(User $user) |
|
30 | + public function create (User $user) |
|
31 | 31 | { |
32 | - return $user->isApplicant(); |
|
32 | + return $user->isApplicant (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param \App\Models\WorkSample $workSample |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function update(User $user, WorkSample $workSample) |
|
42 | + public function update (User $user, WorkSample $workSample) |
|
43 | 43 | { |
44 | - return $user->isApplicant() && $workSample->applicant->user->is($user); |
|
44 | + return $user->isApplicant () && $workSample->applicant->user->is ($user); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * @param \App\Models\WorkSample $workSample |
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | - public function delete(User $user, WorkSample $workSample) |
|
54 | + public function delete (User $user, WorkSample $workSample) |
|
55 | 55 | { |
56 | - return $user->isApplicant() && $workSample->applicant->user->is($user); |
|
56 | + return $user->isApplicant () && $workSample->applicant->user->is ($user); |
|
57 | 57 | } |
58 | 58 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param \App\Models\Course $course |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function view(User $user, Course $course) |
|
19 | + public function view (User $user, Course $course) |
|
20 | 20 | { |
21 | - return $user->isApplicant() && $course->applicant->user->is($user); |
|
21 | + return $user->isApplicant () && $course->applicant->user->is ($user); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @param \App\Models\User $user |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | - public function create(User $user) |
|
30 | + public function create (User $user) |
|
31 | 31 | { |
32 | - return $user->isApplicant(); |
|
32 | + return $user->isApplicant (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param \App\Models\Course $course |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function update(User $user, Course $course) |
|
42 | + public function update (User $user, Course $course) |
|
43 | 43 | { |
44 | - return $user->isApplicant() && $course->applicant->user->is($user); |
|
44 | + return $user->isApplicant () && $course->applicant->user->is ($user); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * @param \App\Models\Course $course |
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | - public function delete(User $user, Course $course) |
|
54 | + public function delete (User $user, Course $course) |
|
55 | 55 | { |
56 | - return $user->isApplicant() && $course->applicant->user->is($user); |
|
56 | + return $user->isApplicant () && $course->applicant->user->is ($user); |
|
57 | 57 | } |
58 | 58 | } |
@@ -16,9 +16,9 @@ discard block |
||
16 | 16 | * @param \App\Models\Degree $degree |
17 | 17 | * @return mixed |
18 | 18 | */ |
19 | - public function view(User $user, Degree $degree) |
|
19 | + public function view (User $user, Degree $degree) |
|
20 | 20 | { |
21 | - return $user->isApplicant() && $degree->applicant->user->is($user); |
|
21 | + return $user->isApplicant () && $degree->applicant->user->is ($user); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | /** |
@@ -27,9 +27,9 @@ discard block |
||
27 | 27 | * @param \App\Models\User $user |
28 | 28 | * @return mixed |
29 | 29 | */ |
30 | - public function create(User $user) |
|
30 | + public function create (User $user) |
|
31 | 31 | { |
32 | - return $user->isApplicant(); |
|
32 | + return $user->isApplicant (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | * @param \App\Models\Degree $degree |
40 | 40 | * @return mixed |
41 | 41 | */ |
42 | - public function update(User $user, Degree $degree) |
|
42 | + public function update (User $user, Degree $degree) |
|
43 | 43 | { |
44 | - return $user->isApplicant() && $degree->applicant->user->is($user); |
|
44 | + return $user->isApplicant () && $degree->applicant->user->is ($user); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | /** |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | * @param \App\Models\Degree $degree |
52 | 52 | * @return mixed |
53 | 53 | */ |
54 | - public function delete(User $user, Degree $degree) |
|
54 | + public function delete (User $user, Degree $degree) |
|
55 | 55 | { |
56 | - return $user->isApplicant() && $degree->applicant->user->is($user); |
|
56 | + return $user->isApplicant () && $degree->applicant->user->is ($user); |
|
57 | 57 | } |
58 | 58 | } |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | * @param App\Models\Applicant $user |
19 | 19 | * @return void |
20 | 20 | */ |
21 | - public function __construct(Applicant $applicant, $skill_declaration_id = null) |
|
21 | + public function __construct (Applicant $applicant, $skill_declaration_id = null) |
|
22 | 22 | { |
23 | 23 | $this->applicant = $applicant; |
24 | 24 | $this->skill_declaration_id = $skill_declaration_id; |
@@ -31,16 +31,16 @@ discard block |
||
31 | 31 | * @param [type] $value [description] |
32 | 32 | * @return [type] [description] |
33 | 33 | */ |
34 | - public function passes($attribute, $value) |
|
34 | + public function passes ($attribute, $value) |
|
35 | 35 | { |
36 | - $prev_skills = $this->applicant->skill_declarations->where('skill_id', $value)->pluck('id'); |
|
36 | + $prev_skills = $this->applicant->skill_declarations->where ('skill_id', $value)->pluck ('id'); |
|
37 | 37 | |
38 | - return $prev_skills->isEmpty() || |
|
39 | - ($this->skill_declaration_id != null && $prev_skills->contains($this->skill_declaration_id)); |
|
38 | + return $prev_skills->isEmpty () || |
|
39 | + ($this->skill_declaration_id != null && $prev_skills->contains ($this->skill_declaration_id)); |
|
40 | 40 | } |
41 | 41 | |
42 | - public function message() |
|
42 | + public function message () |
|
43 | 43 | { |
44 | - return Lang::get('validation.user_skill_unique'); |
|
44 | + return Lang::get ('validation.user_skill_unique'); |
|
45 | 45 | } |
46 | 46 | } |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | * |
18 | 18 | * @return \Illuminate\Http\Response |
19 | 19 | */ |
20 | - public function index() |
|
20 | + public function index () |
|
21 | 21 | { |
22 | - $applications = Auth::user()->applicant->job_applications; |
|
23 | - return view( |
|
22 | + $applications = Auth::user ()->applicant->job_applications; |
|
23 | + return view ( |
|
24 | 24 | 'applicant/application_index', |
25 | 25 | [ |
26 | - 'application_index' => Lang::get('applicant/application_index'), |
|
26 | + 'application_index' => Lang::get ('applicant/application_index'), |
|
27 | 27 | 'applications' => $applications, |
28 | - 'departments_template' => Lang::get('common/lookup/departments'), |
|
28 | + 'departments_template' => Lang::get ('common/lookup/departments'), |
|
29 | 29 | 'manager_profile_photo' => '/images/user.png', // TODO: get real photo. |
30 | 30 | ] |
31 | 31 | ); |
@@ -37,51 +37,50 @@ discard block |
||
37 | 37 | * @param \App\Models\JobApplication $application Incoming Application object. |
38 | 38 | * @return \Illuminate\Http\Response |
39 | 39 | */ |
40 | - public function show(JobApplication $application) |
|
40 | + public function show (JobApplication $application) |
|
41 | 41 | { |
42 | 42 | $criteria = [ |
43 | - 'essential' => $application->job_poster->criteria->filter(function ($value, $key) { |
|
43 | + 'essential' => $application->job_poster->criteria->filter (function ($value, $key) { |
|
44 | 44 | return $value->criteria_type->name == 'essential'; |
45 | 45 | }), |
46 | - 'asset' => $application->job_poster->criteria->filter(function ($value, $key) { |
|
46 | + 'asset' => $application->job_poster->criteria->filter (function ($value, $key) { |
|
47 | 47 | return $value->criteria_type->name == 'asset'; |
48 | 48 | }), |
49 | 49 | ]; |
50 | 50 | |
51 | 51 | // Display slightly different views on different portals. |
52 | - $view = WhichPortal::isManagerPortal() ? |
|
53 | - 'manager/application_post' : |
|
54 | - 'applicant/application_preview'; |
|
52 | + $view = WhichPortal::isManagerPortal () ? |
|
53 | + 'manager/application_post' : 'applicant/application_preview'; |
|
55 | 54 | |
56 | - if (WhichPortal::isManagerPortal()) { |
|
55 | + if (WhichPortal::isManagerPortal ()) { |
|
57 | 56 | // Load things required for review component. |
58 | - $application->load(['veteran_status', 'citizenship_declaration', 'application_review', 'applicant.user']); |
|
57 | + $application->load (['veteran_status', 'citizenship_declaration', 'application_review', 'applicant.user']); |
|
59 | 58 | } |
60 | 59 | |
61 | - return view( |
|
60 | + return view ( |
|
62 | 61 | $view, |
63 | 62 | [ |
64 | 63 | // Localized strings. |
65 | - 'post' => Lang::get('manager/application_post'), // Change text |
|
66 | - 'is_manager_view' => WhichPortal::isManagerPortal(), |
|
64 | + 'post' => Lang::get ('manager/application_post'), // Change text |
|
65 | + 'is_manager_view' => WhichPortal::isManagerPortal (), |
|
67 | 66 | // Application Template Data. |
68 | - 'application_template' => Lang::get('applicant/application_template'), |
|
67 | + 'application_template' => Lang::get ('applicant/application_template'), |
|
69 | 68 | 'application_preview' => true, |
70 | - 'preferred_language_template' => Lang::get('common/preferred_language'), |
|
71 | - 'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'), |
|
72 | - 'veteran_status_template' => Lang::get('common/veteran_status'), |
|
69 | + 'preferred_language_template' => Lang::get ('common/preferred_language'), |
|
70 | + 'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'), |
|
71 | + 'veteran_status_template' => Lang::get ('common/veteran_status'), |
|
73 | 72 | // Job Data. |
74 | 73 | 'job' => $application->job_poster, |
75 | 74 | // Skills Data. |
76 | - 'skills' => Skill::all(), |
|
77 | - 'skill_template' => Lang::get('common/skills'), |
|
78 | - 'reference_template' => Lang::get('common/references'), |
|
79 | - 'sample_template' => Lang::get('common/work_samples'), |
|
75 | + 'skills' => Skill::all (), |
|
76 | + 'skill_template' => Lang::get ('common/skills'), |
|
77 | + 'reference_template' => Lang::get ('common/references'), |
|
78 | + 'sample_template' => Lang::get ('common/work_samples'), |
|
80 | 79 | 'criteria' => $criteria, |
81 | 80 | // Applicant Data. |
82 | 81 | 'applicant' => $application->applicant, |
83 | 82 | 'job_application' => $application, |
84 | - 'review_statuses' => ReviewStatus::all(), |
|
83 | + 'review_statuses' => ReviewStatus::all (), |
|
85 | 84 | ] |
86 | 85 | ); |
87 | 86 | } |
@@ -93,18 +92,18 @@ discard block |
||
93 | 92 | * @param \App\Models\JobApplication $application Incoming Application object. |
94 | 93 | * @return \Illuminate\Http\Response |
95 | 94 | */ |
96 | - public function destroy(Request $request, JobApplication $application) |
|
95 | + public function destroy (Request $request, JobApplication $application) |
|
97 | 96 | { |
98 | - $this->authorize('delete', $application); |
|
97 | + $this->authorize ('delete', $application); |
|
99 | 98 | |
100 | - $application->delete(); |
|
99 | + $application->delete (); |
|
101 | 100 | |
102 | - if ($request->ajax()) { |
|
101 | + if ($request->ajax ()) { |
|
103 | 102 | return [ |
104 | 103 | 'message' => 'Application deleted' |
105 | 104 | ]; |
106 | 105 | } |
107 | 106 | |
108 | - return redirect()->back(); |
|
107 | + return redirect ()->back (); |
|
109 | 108 | } |
110 | 109 | } |
@@ -19,10 +19,10 @@ discard block |
||
19 | 19 | * @param \Illuminate\Http\Request $request Incoming Request. |
20 | 20 | * @return \Illuminate\Http\Response |
21 | 21 | */ |
22 | - public function editAuthenticated(Request $request) |
|
22 | + public function editAuthenticated (Request $request) |
|
23 | 23 | { |
24 | - $applicant = $request->user()->applicant; |
|
25 | - return redirect(route('profile.experience.edit', $applicant)); |
|
24 | + $applicant = $request->user ()->applicant; |
|
25 | + return redirect (route ('profile.experience.edit', $applicant)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -32,13 +32,13 @@ discard block |
||
32 | 32 | * @param \App\Models\Applicant $applicant Incoming applicant object. |
33 | 33 | * @return \Illuminate\Http\Response |
34 | 34 | */ |
35 | - public function edit(Request $request, Applicant $applicant) |
|
35 | + public function edit (Request $request, Applicant $applicant) |
|
36 | 36 | { |
37 | - return view('applicant/profile_02_experience', [ |
|
37 | + return view ('applicant/profile_02_experience', [ |
|
38 | 38 | 'applicant' => $applicant, |
39 | - 'profile' => Lang::get('applicant/profile_experience'), |
|
40 | - 'work_template' => Lang::get('common/work_experience'), |
|
41 | - 'form_submit_action' => route('profile.experience.update', $applicant) |
|
39 | + 'profile' => Lang::get ('applicant/profile_experience'), |
|
40 | + 'work_template' => Lang::get ('common/work_experience'), |
|
41 | + 'form_submit_action' => route ('profile.experience.update', $applicant) |
|
42 | 42 | ]); |
43 | 43 | } |
44 | 44 | |
@@ -49,13 +49,13 @@ discard block |
||
49 | 49 | * @param \App\Models\Applicant $applicant Incoming Applicant. |
50 | 50 | * @return \Illuminate\Http\Response |
51 | 51 | */ |
52 | - public function update(Request $request, Applicant $applicant) |
|
52 | + public function update (Request $request, Applicant $applicant) |
|
53 | 53 | { |
54 | - $input = $request->input(); |
|
54 | + $input = $request->input (); |
|
55 | 55 | |
56 | 56 | $degrees = $input['degrees']; |
57 | 57 | |
58 | - $request->validate([ |
|
58 | + $request->validate ([ |
|
59 | 59 | 'degrees.new.*.degree_type_id' => 'required', |
60 | 60 | 'degrees.new.*.area_of_study' => 'required', |
61 | 61 | 'degrees.new.*.institution' => 'required', |
@@ -72,16 +72,16 @@ discard block |
||
72 | 72 | // Check if no degrees were resubmitted, or if this specific one wasn't. |
73 | 73 | if (!isset($degrees['old']) || |
74 | 74 | !isset($degrees['old'][$oldDegree->id])) { |
75 | - $oldDegree->delete(); |
|
75 | + $oldDegree->delete (); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | 79 | // Save new degrees. |
80 | 80 | if (isset($degrees['new'])) { |
81 | 81 | foreach ($degrees['new'] as $degreeInput) { |
82 | - $degree = new Degree(); |
|
82 | + $degree = new Degree (); |
|
83 | 83 | $degree->applicant_id = $applicant->id; |
84 | - $degree->fill([ |
|
84 | + $degree->fill ([ |
|
85 | 85 | 'degree_type_id' => $degreeInput['degree_type_id'], |
86 | 86 | 'area_of_study' => $degreeInput['area_of_study'], |
87 | 87 | 'institution' => $degreeInput['institution'], |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | 'end_date' => $degreeInput['end_date'], |
91 | 91 | 'blockcert_url' => $degreeInput['blockcert_url'], |
92 | 92 | ]); |
93 | - $degree->save(); |
|
93 | + $degree->save (); |
|
94 | 94 | } |
95 | 95 | } |
96 | 96 | |
@@ -98,9 +98,9 @@ discard block |
||
98 | 98 | if (isset($degrees['old'])) { |
99 | 99 | foreach ($degrees['old'] as $id => $degreeInput) { |
100 | 100 | // Ensure this degree belongs to this applicant. |
101 | - $degree = $applicant->degrees->firstWhere('id', $id); |
|
101 | + $degree = $applicant->degrees->firstWhere ('id', $id); |
|
102 | 102 | if ($degree != null) { |
103 | - $degree->fill([ |
|
103 | + $degree->fill ([ |
|
104 | 104 | 'degree_type_id' => $degreeInput['degree_type_id'], |
105 | 105 | 'area_of_study' => $degreeInput['area_of_study'], |
106 | 106 | 'institution' => $degreeInput['institution'], |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | 'end_date' => $degreeInput['end_date'], |
110 | 110 | 'blockcert_url' => $degreeInput['blockcert_url'], |
111 | 111 | ]); |
112 | - $degree->save(); |
|
112 | + $degree->save (); |
|
113 | 113 | } else { |
114 | - Log::warning("Applicant $applicant->id attempted to update degree with invalid id: $id"); |
|
114 | + Log::warning ("Applicant $applicant->id attempted to update degree with invalid id: $id"); |
|
115 | 115 | } |
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
119 | 119 | $courses = $input['courses']; |
120 | 120 | |
121 | - $request->validate([ |
|
121 | + $request->validate ([ |
|
122 | 122 | 'courses.new.*.name' => 'required', |
123 | 123 | 'courses.new.*.institution' => 'required', |
124 | 124 | 'courses.new.*.course_status_id' => 'required', |
@@ -133,23 +133,23 @@ discard block |
||
133 | 133 | // Check if no courses were resubmitted, or if this specific one wasn't. |
134 | 134 | if (!isset($courses['old']) || |
135 | 135 | !isset($courses['old'][$oldCourse->id])) { |
136 | - $oldCourse->delete(); |
|
136 | + $oldCourse->delete (); |
|
137 | 137 | } |
138 | 138 | } |
139 | 139 | |
140 | 140 | // Save new courses. |
141 | 141 | if (isset($courses['new'])) { |
142 | 142 | foreach ($courses['new'] as $courseInput) { |
143 | - $course = new Course(); |
|
143 | + $course = new Course (); |
|
144 | 144 | $course->applicant_id = $applicant->id; |
145 | - $course->fill([ |
|
145 | + $course->fill ([ |
|
146 | 146 | 'name' => $courseInput['name'], |
147 | 147 | 'institution' => $courseInput['institution'], |
148 | 148 | 'course_status_id' => $courseInput['course_status_id'], |
149 | 149 | 'start_date' => $courseInput['start_date'], |
150 | 150 | 'end_date' => $courseInput['end_date'] |
151 | 151 | ]); |
152 | - $course->save(); |
|
152 | + $course->save (); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 | |
@@ -157,25 +157,25 @@ discard block |
||
157 | 157 | if (isset($courses['old'])) { |
158 | 158 | foreach ($courses['old'] as $id => $courseInput) { |
159 | 159 | // Ensure this course belongs to this applicant. |
160 | - $course = $applicant->courses->firstWhere('id', $id); |
|
160 | + $course = $applicant->courses->firstWhere ('id', $id); |
|
161 | 161 | if ($course != null) { |
162 | - $course->fill([ |
|
162 | + $course->fill ([ |
|
163 | 163 | 'name' => $courseInput['name'], |
164 | 164 | 'institution' => $courseInput['institution'], |
165 | 165 | 'course_status_id' => $courseInput['course_status_id'], |
166 | 166 | 'start_date' => $courseInput['start_date'], |
167 | 167 | 'end_date' => $courseInput['end_date'] |
168 | 168 | ]); |
169 | - $course->save(); |
|
169 | + $course->save (); |
|
170 | 170 | } else { |
171 | - Log::warning("Applicant $applicant->id attempted to update course with invalid id: $id"); |
|
171 | + Log::warning ("Applicant $applicant->id attempted to update course with invalid id: $id"); |
|
172 | 172 | } |
173 | 173 | } |
174 | 174 | } |
175 | 175 | |
176 | 176 | $work_experiences = $input['work_experiences']; |
177 | 177 | |
178 | - $request->validate([ |
|
178 | + $request->validate ([ |
|
179 | 179 | 'work_experiences.new.*.role' => 'required', |
180 | 180 | 'work_experiences.new.*.company' => 'required', |
181 | 181 | 'work_experiences.new.*.description' => 'required', |
@@ -190,23 +190,23 @@ discard block |
||
190 | 190 | // Check if no work_experiences were resubmitted, or if this specific one wasn't. |
191 | 191 | if (!isset($work_experiences['old']) || |
192 | 192 | !isset($work_experiences['old'][$oldWorkExperience->id])) { |
193 | - $oldWorkExperience->delete(); |
|
193 | + $oldWorkExperience->delete (); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | 197 | // Save new work_experiences. |
198 | 198 | if (isset($work_experiences['new'])) { |
199 | 199 | foreach ($work_experiences['new'] as $workExperienceInput) { |
200 | - $workExperience = new WorkExperience(); |
|
200 | + $workExperience = new WorkExperience (); |
|
201 | 201 | $workExperience->applicant_id = $applicant->id; |
202 | - $workExperience->fill([ |
|
202 | + $workExperience->fill ([ |
|
203 | 203 | 'role' => $workExperienceInput['role'], |
204 | 204 | 'company' => $workExperienceInput['company'], |
205 | 205 | 'description' => $workExperienceInput['description'], |
206 | 206 | 'start_date' => $workExperienceInput['start_date'], |
207 | 207 | 'end_date' => $workExperienceInput['end_date'] |
208 | 208 | ]); |
209 | - $workExperience->save(); |
|
209 | + $workExperience->save (); |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
@@ -214,22 +214,22 @@ discard block |
||
214 | 214 | if (isset($work_experiences['old'])) { |
215 | 215 | foreach ($work_experiences['old'] as $id => $workExperienceInput) { |
216 | 216 | // Ensure this work_experience belongs to this applicant. |
217 | - $workExperience = $applicant->work_experiences->firstWhere('id', $id); |
|
217 | + $workExperience = $applicant->work_experiences->firstWhere ('id', $id); |
|
218 | 218 | if ($workExperience != null) { |
219 | - $workExperience->fill([ |
|
219 | + $workExperience->fill ([ |
|
220 | 220 | 'role' => $workExperienceInput['role'], |
221 | 221 | 'company' => $workExperienceInput['company'], |
222 | 222 | 'description' => $workExperienceInput['description'], |
223 | 223 | 'start_date' => $workExperienceInput['start_date'], |
224 | 224 | 'end_date' => $workExperienceInput['end_date'] |
225 | 225 | ]); |
226 | - $workExperience->save(); |
|
226 | + $workExperience->save (); |
|
227 | 227 | } else { |
228 | - Log::warning("Applicant $applicant->id attempted to update work_experience with invalid id: $id"); |
|
228 | + Log::warning ("Applicant $applicant->id attempted to update work_experience with invalid id: $id"); |
|
229 | 229 | } |
230 | 230 | } |
231 | 231 | } |
232 | 232 | |
233 | - return redirect(route('profile.experience.edit', $applicant)); |
|
233 | + return redirect (route ('profile.experience.edit', $applicant)); |
|
234 | 234 | } |
235 | 235 | } |