@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function editAuthenticated(Request $request) |
23 | 23 | { |
24 | - $applicant = $request->user()->applicant; |
|
25 | - return redirect(route('profile.references.edit', $applicant)); |
|
24 | + $applicant = $request->user ()->applicant; |
|
25 | + return redirect (route ('profile.references.edit', $applicant)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -34,14 +34,14 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function edit(Request $request, Applicant $applicant) |
36 | 36 | { |
37 | - $applicant->load([ |
|
37 | + $applicant->load ([ |
|
38 | 38 | 'references.projects', |
39 | 39 | 'skill_declarations.skill', |
40 | 40 | ]); |
41 | 41 | |
42 | - return view('applicant/profile_04_references', [ |
|
42 | + return view ('applicant/profile_04_references', [ |
|
43 | 43 | 'applicant' => $applicant, |
44 | - 'profile' => Lang::get('applicant/profile_references'), |
|
44 | + 'profile' => Lang::get ('applicant/profile_references'), |
|
45 | 45 | ]); |
46 | 46 | } |
47 | 47 | |
@@ -54,54 +54,54 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function update(Request $request, ?Reference $reference = null) |
56 | 56 | { |
57 | - $validator = new UpdateReferenceValidator(); |
|
58 | - $validator->validate($request->input()); |
|
57 | + $validator = new UpdateReferenceValidator (); |
|
58 | + $validator->validate ($request->input ()); |
|
59 | 59 | |
60 | 60 | if ($reference === null) { |
61 | - $reference = new Reference(); |
|
62 | - $reference->applicant_id = $request->user()->applicant->id; |
|
61 | + $reference = new Reference (); |
|
62 | + $reference->applicant_id = $request->user ()->applicant->id; |
|
63 | 63 | } |
64 | - $reference->fill([ |
|
65 | - 'name' => $request->input('name'), |
|
66 | - 'email' => $request->input('email'), |
|
67 | - 'relationship_id' => $request->input('relationship_id'), |
|
68 | - 'description' => $request->input('description'), |
|
64 | + $reference->fill ([ |
|
65 | + 'name' => $request->input ('name'), |
|
66 | + 'email' => $request->input ('email'), |
|
67 | + 'relationship_id' => $request->input ('relationship_id'), |
|
68 | + 'description' => $request->input ('description'), |
|
69 | 69 | ]); |
70 | - $reference->save(); |
|
70 | + $reference->save (); |
|
71 | 71 | |
72 | - $reference->load('projects'); |
|
72 | + $reference->load ('projects'); |
|
73 | 73 | |
74 | 74 | // TODO: As soon as you can interact with projects outside of references, |
75 | 75 | // this will become a dangerous operation. |
76 | - $reference->projects()->delete(); |
|
76 | + $reference->projects ()->delete (); |
|
77 | 77 | |
78 | 78 | $newProjects = []; |
79 | - if ($request->input('projects')) { |
|
80 | - foreach ($request->input('projects') as $projectInput) { |
|
81 | - $project = new Project(); |
|
79 | + if ($request->input ('projects')) { |
|
80 | + foreach ($request->input ('projects') as $projectInput) { |
|
81 | + $project = new Project (); |
|
82 | 82 | $project->applicant_id = $reference->applicant_id; |
83 | - $project->fill([ |
|
83 | + $project->fill ([ |
|
84 | 84 | 'name' => $projectInput['name'], |
85 | 85 | 'start_date' => $projectInput['start_date'], |
86 | 86 | 'end_date' => $projectInput['end_date'], |
87 | 87 | ]); |
88 | - $project->save(); |
|
88 | + $project->save (); |
|
89 | 89 | $newProjects[] = $project->id; |
90 | 90 | } |
91 | 91 | } |
92 | - $reference->projects()->sync($newProjects); |
|
92 | + $reference->projects ()->sync ($newProjects); |
|
93 | 93 | |
94 | 94 | // Attach relatives. |
95 | - $skillIds = $this->getRelativeIds($request->input(), 'skills'); |
|
96 | - $reference->skill_declarations()->sync($skillIds); |
|
95 | + $skillIds = $this->getRelativeIds ($request->input (), 'skills'); |
|
96 | + $reference->skill_declarations ()->sync ($skillIds); |
|
97 | 97 | |
98 | 98 | // If an ajax request, return the new object. |
99 | - if ($request->ajax()) { |
|
100 | - $reference->load('relationship'); |
|
101 | - $reference->load('projects'); |
|
102 | - return $reference->toJson(); |
|
99 | + if ($request->ajax ()) { |
|
100 | + $reference->load ('relationship'); |
|
101 | + $reference->load ('projects'); |
|
102 | + return $reference->toJson (); |
|
103 | 103 | } else { |
104 | - return redirect()->back(); |
|
104 | + return redirect ()->back (); |
|
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function destroy(Request $request, Reference $reference) |
116 | 116 | { |
117 | - $this->authorize('delete', $reference); |
|
117 | + $this->authorize ('delete', $reference); |
|
118 | 118 | |
119 | 119 | // TODO: when projects exist independently on profile, delete separately. |
120 | - $reference->projects()->delete(); |
|
120 | + $reference->projects ()->delete (); |
|
121 | 121 | |
122 | - $reference->delete(); |
|
122 | + $reference->delete (); |
|
123 | 123 | |
124 | - if ($request->ajax()) { |
|
124 | + if ($request->ajax ()) { |
|
125 | 125 | return [ |
126 | 126 | 'message' => 'Reference deleted' |
127 | 127 | ]; |
128 | 128 | } |
129 | 129 | |
130 | - return redirect()->back(); |
|
130 | + return redirect ()->back (); |
|
131 | 131 | } |
132 | 132 | } |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | */ |
22 | 22 | public function editAuthenticated(Request $request) |
23 | 23 | { |
24 | - $applicant = $request->user()->applicant; |
|
25 | - return redirect(route('profile.skills.edit', $applicant)); |
|
24 | + $applicant = $request->user ()->applicant; |
|
25 | + return redirect (route ('profile.skills.edit', $applicant)); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function edit(Request $request, Applicant $applicant) |
36 | 36 | { |
37 | - $applicant->load([ |
|
37 | + $applicant->load ([ |
|
38 | 38 | 'skill_declarations.skill.skill_type', |
39 | 39 | 'skill_declarations.skill_status', |
40 | 40 | 'skill_declarations.skill_level', |
41 | 41 | ]); |
42 | 42 | |
43 | - return view('applicant/profile_03_skills', [ |
|
43 | + return view ('applicant/profile_03_skills', [ |
|
44 | 44 | 'applicant' => $applicant, |
45 | - 'profile' => Lang::get('applicant/profile_skills'), |
|
46 | - 'skills_modals' => Lang::get('common/skills_modals'), |
|
45 | + 'profile' => Lang::get ('applicant/profile_skills'), |
|
46 | + 'skills_modals' => Lang::get ('common/skills_modals'), |
|
47 | 47 | ]); |
48 | 48 | } |
49 | 49 | |
@@ -55,23 +55,23 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function create(Request $request) |
57 | 57 | { |
58 | - $this->authorize('create', SkillDeclaration::class); |
|
58 | + $this->authorize ('create', SkillDeclaration::class); |
|
59 | 59 | |
60 | - $user = $request->user(); |
|
60 | + $user = $request->user (); |
|
61 | 61 | $applicant = $user->applicant; |
62 | 62 | |
63 | 63 | // Get the default claim status id. |
64 | - $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id; |
|
64 | + $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id; |
|
65 | 65 | |
66 | 66 | // Create a new Skill Declaration |
67 | 67 | // But don't save, as it hasn't been validated yet. |
68 | - $skillDeclaration = new SkillDeclaration(); |
|
68 | + $skillDeclaration = new SkillDeclaration (); |
|
69 | 69 | $skillDeclaration->applicant_id = $applicant->id; |
70 | - $skillDeclaration->skill_id = $request->input('skill_id'); |
|
70 | + $skillDeclaration->skill_id = $request->input ('skill_id'); |
|
71 | 71 | $skillDeclaration->skill_status_id = $claimedStatusId; |
72 | 72 | |
73 | 73 | // Update variable fields in skill declaration. |
74 | - return $this->updateSkillDeclaration($request, $skillDeclaration); |
|
74 | + return $this->updateSkillDeclaration ($request, $skillDeclaration); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -83,9 +83,9 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function update(Request $request, SkillDeclaration $skillDeclaration) |
85 | 85 | { |
86 | - $this->authorize('update', $skillDeclaration); |
|
86 | + $this->authorize ('update', $skillDeclaration); |
|
87 | 87 | |
88 | - return $this->updateSkillDeclaration($request, $skillDeclaration); |
|
88 | + return $this->updateSkillDeclaration ($request, $skillDeclaration); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -98,35 +98,35 @@ discard block |
||
98 | 98 | protected function updateSkillDeclaration(Request $request, SkillDeclaration $skillDeclaration) |
99 | 99 | { |
100 | 100 | // Fill variable values. |
101 | - $skillDeclaration->fill([ |
|
102 | - 'description' => $request->input('description'), |
|
103 | - 'skill_level_id' => $request->input('skill_level_id'), |
|
101 | + $skillDeclaration->fill ([ |
|
102 | + 'description' => $request->input ('description'), |
|
103 | + 'skill_level_id' => $request->input ('skill_level_id'), |
|
104 | 104 | ]); |
105 | 105 | |
106 | 106 | // Validate before saving. |
107 | - $validator = new SkillDeclarationValidator($request->user()->applicant); |
|
108 | - $validator->validate($skillDeclaration); |
|
107 | + $validator = new SkillDeclarationValidator ($request->user ()->applicant); |
|
108 | + $validator->validate ($skillDeclaration); |
|
109 | 109 | |
110 | 110 | // Save this skill declaration. |
111 | - $skillDeclaration->save(); |
|
111 | + $skillDeclaration->save (); |
|
112 | 112 | |
113 | 113 | // Attach relatives. |
114 | - $referenceIds = $this->getRelativeIds($request->input(), 'references'); |
|
115 | - $skillDeclaration->references()->sync($referenceIds); |
|
114 | + $referenceIds = $this->getRelativeIds ($request->input (), 'references'); |
|
115 | + $skillDeclaration->references ()->sync ($referenceIds); |
|
116 | 116 | |
117 | - $sampleIds = $this->getRelativeIds($request->input(), 'samples'); |
|
118 | - $skillDeclaration->work_samples()->sync($sampleIds); |
|
117 | + $sampleIds = $this->getRelativeIds ($request->input (), 'samples'); |
|
118 | + $skillDeclaration->work_samples ()->sync ($sampleIds); |
|
119 | 119 | |
120 | 120 | // If an ajax request, return the new object. |
121 | - if ($request->ajax()) { |
|
122 | - $skillDeclaration->load('references'); |
|
123 | - $skillDeclaration->load('work_samples'); |
|
124 | - $skillDeclaration->load('skill'); |
|
125 | - $skillDeclaration->load('skill_status'); |
|
126 | - return $skillDeclaration->toJson(); |
|
121 | + if ($request->ajax ()) { |
|
122 | + $skillDeclaration->load ('references'); |
|
123 | + $skillDeclaration->load ('work_samples'); |
|
124 | + $skillDeclaration->load ('skill'); |
|
125 | + $skillDeclaration->load ('skill_status'); |
|
126 | + return $skillDeclaration->toJson (); |
|
127 | 127 | } |
128 | 128 | |
129 | - return redirect()->back(); |
|
129 | + return redirect ()->back (); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -138,13 +138,13 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function destroy(Request $request, SkillDeclaration $skillDeclaration) |
140 | 140 | { |
141 | - $this->authorize('delete', $skillDeclaration); |
|
142 | - $skillDeclaration->delete(); |
|
141 | + $this->authorize ('delete', $skillDeclaration); |
|
142 | + $skillDeclaration->delete (); |
|
143 | 143 | |
144 | - if ($request->ajax()) { |
|
144 | + if ($request->ajax ()) { |
|
145 | 145 | return ['message' => 'Skill deleted']; |
146 | 146 | } |
147 | 147 | |
148 | - return redirect()->back(); |
|
148 | + return redirect ()->back (); |
|
149 | 149 | } |
150 | 150 | } |
@@ -27,20 +27,20 @@ discard block |
||
27 | 27 | |
28 | 28 | public function shiftFirstLevelArrayKeysToBottom(array $nestedArray) |
29 | 29 | { |
30 | - $expandedArray = $this->expandNestedArraysIntoKeyListAndValue($nestedArray); |
|
31 | - $rotatedArray = $this->rotateKeys($expandedArray, 1); |
|
32 | - $mergedArray = $this->mergeExpandedTrees($rotatedArray); |
|
30 | + $expandedArray = $this->expandNestedArraysIntoKeyListAndValue ($nestedArray); |
|
31 | + $rotatedArray = $this->rotateKeys ($expandedArray, 1); |
|
32 | + $mergedArray = $this->mergeExpandedTrees ($rotatedArray); |
|
33 | 33 | return $mergedArray; |
34 | 34 | } |
35 | 35 | |
36 | 36 | protected function addKeyAsFinalIndex($finalKey, $array) |
37 | 37 | { |
38 | - if (!is_array($array)) { |
|
38 | + if (!is_array ($array)) { |
|
39 | 39 | return [$finalKey => $array]; |
40 | 40 | } else { |
41 | 41 | $newArray = []; |
42 | 42 | foreach ($array as $key => $value) { |
43 | - $newArray[$key] = $this->addKeyAsFinalIndex($finalKey, $value); |
|
43 | + $newArray[$key] = $this->addKeyAsFinalIndex ($finalKey, $value); |
|
44 | 44 | } |
45 | 45 | return $newArray; |
46 | 46 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | protected function expandNestedArraysIntoKeyListAndValue($nestedArray) |
50 | 50 | { |
51 | - if (!is_array($nestedArray)) { |
|
51 | + if (!is_array ($nestedArray)) { |
|
52 | 52 | $expandedArray = [ |
53 | 53 | [ |
54 | 54 | 'keys' => [], |
@@ -59,9 +59,9 @@ discard block |
||
59 | 59 | } else { |
60 | 60 | $expandedArray = []; |
61 | 61 | foreach ($nestedArray as $key => $value) { |
62 | - $subArray = $this->expandNestedArraysIntoKeyListAndValue($value); |
|
62 | + $subArray = $this->expandNestedArraysIntoKeyListAndValue ($value); |
|
63 | 63 | foreach ($subArray as $item) { |
64 | - array_unshift($item['keys'], $key); |
|
64 | + array_unshift ($item['keys'], $key); |
|
65 | 65 | $expandedArray[] = $item; |
66 | 66 | } |
67 | 67 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $mergedArray = []; |
75 | 75 | foreach ($expandedArray as $item) { |
76 | 76 | $tail = &$mergedArray; |
77 | - $size = count($item['keys']); |
|
77 | + $size = count ($item['keys']); |
|
78 | 78 | $i = 0; |
79 | 79 | foreach ($item['keys'] as $key) { |
80 | 80 | $i = ($i + 1); |
@@ -82,17 +82,17 @@ discard block |
||
82 | 82 | if ($i == ($size)) { |
83 | 83 | if (!isset($tail[$key])) { |
84 | 84 | $tail[$key] = $item['value']; |
85 | - } elseif (!is_array($tail[$key])) { |
|
85 | + } elseif (!is_array ($tail[$key])) { |
|
86 | 86 | $value = $tail[$key]; |
87 | 87 | $tail[$key] = [$value, $item['value']]; |
88 | 88 | } else { |
89 | - array_push($tail[$key], $item['value']); |
|
89 | + array_push ($tail[$key], $item['value']); |
|
90 | 90 | } |
91 | 91 | } else { |
92 | 92 | // If this is not the last key, it needs to contain an array. |
93 | 93 | if (!isset($tail[$key])) { |
94 | 94 | $tail[$key] = []; |
95 | - } elseif (!is_array($tail[$key])) { |
|
95 | + } elseif (!is_array ($tail[$key])) { |
|
96 | 96 | $value = $tail[$key]; |
97 | 97 | $tail[$key] = [$value]; |
98 | 98 | } |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | { |
108 | 108 | $rotatedArray = []; |
109 | 109 | foreach ($expandedArray as $item) { |
110 | - for ($i=0; $i<$steps; $i++) { |
|
111 | - array_push($item['keys'], array_shift($item['keys'])); |
|
110 | + for ($i = 0; $i < $steps; $i++) { |
|
111 | + array_push ($item['keys'], array_shift ($item['keys'])); |
|
112 | 112 | } |
113 | 113 | $rotatedArray[] = $item; |
114 | 114 | } |
@@ -123,6 +123,6 @@ discard block |
||
123 | 123 | */ |
124 | 124 | protected function formatAjaxResponse(array $content) |
125 | 125 | { |
126 | - return response()->json($content); |
|
126 | + return response ()->json ($content); |
|
127 | 127 | } |
128 | 128 | } |
@@ -14,11 +14,11 @@ |
||
14 | 14 | */ |
15 | 15 | public function __invoke() |
16 | 16 | { |
17 | - return view( |
|
17 | + return view ( |
|
18 | 18 | 'applicant/static_faq', |
19 | 19 | [ |
20 | - 'faq' => Lang::get('applicant/faq'), |
|
21 | - 'breadcrumb_home' => route('home'), |
|
20 | + 'faq' => Lang::get ('applicant/faq'), |
|
21 | + 'breadcrumb_home' => route ('home'), |
|
22 | 22 | 'applicant_sidebar_active' => 'active', |
23 | 23 | ] |
24 | 24 | ); |
@@ -19,29 +19,29 @@ |
||
19 | 19 | */ |
20 | 20 | public function updateForApplication(Request $request, JobApplication $application) |
21 | 21 | { |
22 | - $request->validate([ |
|
22 | + $request->validate ([ |
|
23 | 23 | 'review_status_id' => [ |
24 | 24 | 'nullable', |
25 | - Rule::in(ReviewStatus::all()->pluck('id')->toArray()) |
|
25 | + Rule::in (ReviewStatus::all ()->pluck ('id')->toArray ()) |
|
26 | 26 | ], |
27 | 27 | 'notes' => 'nullable|string' |
28 | 28 | ]); |
29 | 29 | |
30 | 30 | $review = $application->application_review; |
31 | 31 | if ($review === null) { |
32 | - $review = new ApplicationReview(); |
|
33 | - $review->job_application()->associate($application); |
|
32 | + $review = new ApplicationReview (); |
|
33 | + $review->job_application ()->associate ($application); |
|
34 | 34 | } |
35 | - $review->fill([ |
|
36 | - 'review_status_id' => $request->input('review_status_id'), |
|
37 | - 'notes' => $request->input('notes'), |
|
35 | + $review->fill ([ |
|
36 | + 'review_status_id' => $request->input ('review_status_id'), |
|
37 | + 'notes' => $request->input ('notes'), |
|
38 | 38 | ]); |
39 | - $review->save(); |
|
39 | + $review->save (); |
|
40 | 40 | |
41 | - if ($request->ajax()) { |
|
42 | - return $review->fresh()->toJson(); |
|
41 | + if ($request->ajax ()) { |
|
42 | + return $review->fresh ()->toJson (); |
|
43 | 43 | } |
44 | 44 | |
45 | - return redirect()->back(); |
|
45 | + return redirect ()->back (); |
|
46 | 46 | } |
47 | 47 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() |
30 | 30 | { |
31 | - $this->middleware('guest'); |
|
31 | + $this->middleware ('guest'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function showLinkRequestForm() |
42 | 42 | { |
43 | - return view('auth.passwords.email', [ |
|
44 | - 'routes' => $this->auth_routes(), |
|
45 | - 'forgot_password' => Lang::get('common/auth/forgot_password'), |
|
43 | + return view ('auth.passwords.email', [ |
|
44 | + 'routes' => $this->auth_routes (), |
|
45 | + 'forgot_password' => Lang::get ('common/auth/forgot_password'), |
|
46 | 46 | ]); |
47 | 47 | } |
48 | 48 | } |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | { |
20 | 20 | // Authorization handled by the FormRequest. |
21 | 21 | // Data validation handled by this line. |
22 | - $data = $request->validated(); |
|
23 | - $ratingGuideAnswer = new RatingGuideAnswer($data); |
|
24 | - $ratingGuideAnswer->save(); |
|
22 | + $data = $request->validated (); |
|
23 | + $ratingGuideAnswer = new RatingGuideAnswer ($data); |
|
24 | + $ratingGuideAnswer->save (); |
|
25 | 25 | |
26 | 26 | return [ |
27 | 27 | 'success' => "Successfully created rating guide answer $ratingGuideAnswer->id", |
28 | - 'rating_guide_answer' => $ratingGuideAnswer->toArray(), |
|
28 | + 'rating_guide_answer' => $ratingGuideAnswer->toArray (), |
|
29 | 29 | ]; |
30 | 30 | } |
31 | 31 | |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function show(RatingGuideAnswer $ratingGuideAnswer) |
39 | 39 | { |
40 | - $this->authorize('view', $ratingGuideAnswer); |
|
41 | - return $ratingGuideAnswer->toArray(); |
|
40 | + $this->authorize ('view', $ratingGuideAnswer); |
|
41 | + return $ratingGuideAnswer->toArray (); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | { |
54 | 54 | // Authorization handled by the FormRequest. |
55 | 55 | // Data validation handled by this line. |
56 | - $data = $request->validated(); |
|
56 | + $data = $request->validated (); |
|
57 | 57 | |
58 | - $ratingGuideAnswer->fill($data); |
|
59 | - $ratingGuideAnswer->save(); |
|
60 | - $ratingGuideAnswer->refresh(); |
|
58 | + $ratingGuideAnswer->fill ($data); |
|
59 | + $ratingGuideAnswer->save (); |
|
60 | + $ratingGuideAnswer->refresh (); |
|
61 | 61 | return [ |
62 | 62 | 'success' => "Successfully updated rating guide answer $ratingGuideAnswer->id", |
63 | - 'rating_guide_answer' => $ratingGuideAnswer->toArray(), |
|
63 | + 'rating_guide_answer' => $ratingGuideAnswer->toArray (), |
|
64 | 64 | ]; |
65 | 65 | } |
66 | 66 | |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function destroy(RatingGuideAnswer $ratingGuideAnswer) |
74 | 74 | { |
75 | - $this->authorize('delete', $ratingGuideAnswer); |
|
76 | - $ratingGuideAnswer->delete(); |
|
75 | + $this->authorize ('delete', $ratingGuideAnswer); |
|
76 | + $ratingGuideAnswer->delete (); |
|
77 | 77 | |
78 | 78 | return [ |
79 | 79 | 'success' => "Successfully deleted rating guide answer $ratingGuideAnswer->id" |
@@ -19,8 +19,8 @@ discard block |
||
19 | 19 | */ |
20 | 20 | public function editAuthenticated(Request $request) |
21 | 21 | { |
22 | - $applicant = $request->user()->applicant; |
|
23 | - return redirect(route('profile.work_samples.edit', $applicant)); |
|
22 | + $applicant = $request->user ()->applicant; |
|
23 | + return redirect (route ('profile.work_samples.edit', $applicant)); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
@@ -32,14 +32,14 @@ discard block |
||
32 | 32 | */ |
33 | 33 | public function edit(Request $request, Applicant $applicant) |
34 | 34 | { |
35 | - $applicant->load([ |
|
35 | + $applicant->load ([ |
|
36 | 36 | 'work_samples', |
37 | 37 | 'skill_declarations.skill', |
38 | 38 | ]); |
39 | 39 | |
40 | - return view('applicant/profile_05_portfolio', [ |
|
40 | + return view ('applicant/profile_05_portfolio', [ |
|
41 | 41 | 'applicant' => $applicant, |
42 | - 'profile' => Lang::get('applicant/profile_work_samples'), |
|
42 | + 'profile' => Lang::get ('applicant/profile_work_samples'), |
|
43 | 43 | ]); |
44 | 44 | } |
45 | 45 | |
@@ -52,31 +52,31 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function update(Request $request, ?WorkSample $workSample = null) |
54 | 54 | { |
55 | - $validator = new UpdateWorkSampleValidator(); |
|
56 | - $validator->validate($request->input()); |
|
55 | + $validator = new UpdateWorkSampleValidator (); |
|
56 | + $validator->validate ($request->input ()); |
|
57 | 57 | |
58 | 58 | if ($workSample === null) { |
59 | - $workSample = new WorkSample(); |
|
60 | - $workSample->applicant_id = $request->user()->applicant->id; |
|
59 | + $workSample = new WorkSample (); |
|
60 | + $workSample->applicant_id = $request->user ()->applicant->id; |
|
61 | 61 | } |
62 | - $workSample->fill([ |
|
63 | - 'name' => $request->input('name'), |
|
64 | - 'file_type_id' => $request->input('file_type_id'), |
|
65 | - 'url' => $request->input('url'), |
|
66 | - 'description' => $request->input('description'), |
|
62 | + $workSample->fill ([ |
|
63 | + 'name' => $request->input ('name'), |
|
64 | + 'file_type_id' => $request->input ('file_type_id'), |
|
65 | + 'url' => $request->input ('url'), |
|
66 | + 'description' => $request->input ('description'), |
|
67 | 67 | ]); |
68 | - $workSample->save(); |
|
68 | + $workSample->save (); |
|
69 | 69 | |
70 | 70 | // Attach relatives. |
71 | - $skillIds = $this->getRelativeIds($request->input(), 'skills'); |
|
72 | - $workSample->skill_declarations()->sync($skillIds); |
|
71 | + $skillIds = $this->getRelativeIds ($request->input (), 'skills'); |
|
72 | + $workSample->skill_declarations ()->sync ($skillIds); |
|
73 | 73 | |
74 | 74 | // If an ajax request, return the new object. |
75 | - if ($request->ajax()) { |
|
76 | - $workSample->load('file_type'); |
|
77 | - return $workSample->toJson(); |
|
75 | + if ($request->ajax ()) { |
|
76 | + $workSample->load ('file_type'); |
|
77 | + return $workSample->toJson (); |
|
78 | 78 | } else { |
79 | - return redirect()->back(); |
|
79 | + return redirect ()->back (); |
|
80 | 80 | } |
81 | 81 | } |
82 | 82 | |
@@ -89,16 +89,16 @@ discard block |
||
89 | 89 | */ |
90 | 90 | public function destroy(Request $request, WorkSample $workSample) |
91 | 91 | { |
92 | - $this->authorize('delete', $workSample); |
|
92 | + $this->authorize ('delete', $workSample); |
|
93 | 93 | |
94 | - $workSample->delete(); |
|
94 | + $workSample->delete (); |
|
95 | 95 | |
96 | - if ($request->ajax()) { |
|
96 | + if ($request->ajax ()) { |
|
97 | 97 | return [ |
98 | 98 | 'message' => 'Work sample deleted' |
99 | 99 | ]; |
100 | 100 | } |
101 | 101 | |
102 | - return redirect()->back(); |
|
102 | + return redirect ()->back (); |
|
103 | 103 | } |
104 | 104 | } |
@@ -28,8 +28,8 @@ discard block |
||
28 | 28 | // ->hourly(); |
29 | 29 | |
30 | 30 | // start the queue daemon, if its not running |
31 | - if (!$this->osProcessIsRunning('queue:work')) { |
|
32 | - $schedule->command('queue:work')->everyMinute(); |
|
31 | + if (!$this->osProcessIsRunning ('queue:work')) { |
|
32 | + $schedule->command ('queue:work')->everyMinute (); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | protected function commands(): void |
42 | 42 | { |
43 | - $this->load(__DIR__.'/Commands'); |
|
43 | + $this->load (__DIR__.'/Commands'); |
|
44 | 44 | |
45 | - require base_path('routes/console.php'); |
|
45 | + require base_path ('routes/console.php'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -54,14 +54,14 @@ discard block |
||
54 | 54 | protected function osProcessIsRunning(string $needle): bool |
55 | 55 | { |
56 | 56 | // get process status. the "-ww"-option is important to get the full output! |
57 | - exec('ps aux -ww', $process_status); |
|
57 | + exec ('ps aux -ww', $process_status); |
|
58 | 58 | |
59 | 59 | |
60 | 60 | // search $needle in process status |
61 | - $result = array_filter( |
|
61 | + $result = array_filter ( |
|
62 | 62 | $process_status, |
63 | 63 | function ($var) use ($needle) { |
64 | - return strpos($var, $needle); |
|
64 | + return strpos ($var, $needle); |
|
65 | 65 | } |
66 | 66 | ); |
67 | 67 |