Passed
Push — dev ( 978589...978589 )
by Grant
09:08
created
app/Http/Controllers/ApplicationByJobController.php 1 patch
Spacing   +215 added lines, -215 removed lines patch added patch discarded remove patch
@@ -32,24 +32,24 @@  discard block
 block discarded – undo
32 32
      * @param  \App\Models\JobPoster $jobPoster Incoming JobPoster object.
33 33
      * @return \Illuminate\Http\Response
34 34
      */
35
-    public function index(JobPoster $jobPoster)
35
+    public function index (JobPoster $jobPoster)
36 36
     {
37
-        $applications = $jobPoster->submitted_applications()
38
-            ->with([
37
+        $applications = $jobPoster->submitted_applications ()
38
+            ->with ([
39 39
                 'veteran_status',
40 40
                 'citizenship_declaration',
41 41
                 'application_review',
42 42
                 'applicant.user',
43 43
                 'job_poster.criteria',
44 44
             ])
45
-            ->get();
46
-        return view('manager/review_applications', [
45
+            ->get ();
46
+        return view ('manager/review_applications', [
47 47
             // Localization Strings.
48
-            'jobs_l10n' => Lang::get('manager/job_index'),
48
+            'jobs_l10n' => Lang::get ('manager/job_index'),
49 49
             // Data.
50
-            'job' => $jobPoster->toApiArray(),
50
+            'job' => $jobPoster->toApiArray (),
51 51
             'applications' => $applications,
52
-            'review_statuses' => ReviewStatus::all()
52
+            'review_statuses' => ReviewStatus::all ()
53 53
         ]);
54 54
     }
55 55
 
@@ -59,16 +59,16 @@  discard block
 block discarded – undo
59 59
      * @param  \App\Models\JobPoster $jobPoster Incoming JobPoster object.
60 60
      * @return mixed|\App\Models\JobApplication
61 61
      */
62
-    protected function getApplicationFromJob(JobPoster $jobPoster)
62
+    protected function getApplicationFromJob (JobPoster $jobPoster)
63 63
     {
64
-        $application = JobApplication::where('applicant_id', Auth::user()->applicant->id)
65
-            ->where('job_poster_id', $jobPoster->id)->first();
64
+        $application = JobApplication::where ('applicant_id', Auth::user ()->applicant->id)
65
+            ->where ('job_poster_id', $jobPoster->id)->first ();
66 66
         if ($application == null) {
67
-            $application = new JobApplication();
67
+            $application = new JobApplication ();
68 68
             $application->job_poster_id = $jobPoster->id;
69
-            $application->applicant_id = Auth::user()->applicant->id;
70
-            $application->application_status_id = ApplicationStatus::where('name', 'draft')->firstOrFail()->id;
71
-            $application->save();
69
+            $application->applicant_id = Auth::user ()->applicant->id;
70
+            $application->application_status_id = ApplicationStatus::where ('name', 'draft')->firstOrFail ()->id;
71
+            $application->save ();
72 72
         }
73 73
         return $application;
74 74
     }
@@ -79,34 +79,34 @@  discard block
 block discarded – undo
79 79
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
80 80
      * @return \Illuminate\Http\Response
81 81
      */
82
-    public function editBasics(JobPoster $jobPoster)
82
+    public function editBasics (JobPoster $jobPoster)
83 83
     {
84
-        $applicant = Auth::user()->applicant;
85
-        $application = $this->getApplicationFromJob($jobPoster);
84
+        $applicant = Auth::user ()->applicant;
85
+        $application = $this->getApplicationFromJob ($jobPoster);
86 86
 
87 87
         // Ensure user has permissions to view and update application.
88
-        $this->authorize('view', $application);
89
-        $this->authorize('update', $application);
88
+        $this->authorize ('view', $application);
89
+        $this->authorize ('update', $application);
90 90
 
91
-        return view(
91
+        return view (
92 92
             'applicant/application_post_01',
93 93
             [
94 94
                 // Application Template Data.
95 95
                 'application_step' => 1,
96
-                'application_template' => Lang::get('applicant/application_template'),
97
-                'language_options' => PreferredLanguage::all(),
98
-                'citizenship_options' => CitizenshipDeclaration::all(),
99
-                'veteran_options' => VeteranStatus::all(),
100
-                'preferred_language_template' => Lang::get('common/preferred_language'),
101
-                'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'),
102
-                'veteran_status_template' => Lang::get('common/veteran_status'),
96
+                'application_template' => Lang::get ('applicant/application_template'),
97
+                'language_options' => PreferredLanguage::all (),
98
+                'citizenship_options' => CitizenshipDeclaration::all (),
99
+                'veteran_options' => VeteranStatus::all (),
100
+                'preferred_language_template' => Lang::get ('common/preferred_language'),
101
+                'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'),
102
+                'veteran_status_template' => Lang::get ('common/veteran_status'),
103 103
                 // Job Data.
104 104
                 'job' => $jobPoster,
105 105
                 // Applicant Data.
106 106
                 'applicant' => $applicant,
107 107
                 'job_application' => $application,
108 108
                 // Submission.
109
-                'form_submit_action' => route('job.application.update.1', $jobPoster)
109
+                'form_submit_action' => route ('job.application.update.1', $jobPoster)
110 110
             ]
111 111
         );
112 112
     }
@@ -117,28 +117,28 @@  discard block
 block discarded – undo
117 117
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
118 118
      * @return \Illuminate\Http\Response
119 119
      */
120
-    public function editExperience(JobPoster $jobPoster)
120
+    public function editExperience (JobPoster $jobPoster)
121 121
     {
122
-        $applicant = Auth::user()->applicant;
123
-        $application = $this->getApplicationFromJob($jobPoster);
122
+        $applicant = Auth::user ()->applicant;
123
+        $application = $this->getApplicationFromJob ($jobPoster);
124 124
 
125 125
         // Ensure user has permissions to view and update application.
126
-        $this->authorize('view', $application);
127
-        $this->authorize('update', $application);
126
+        $this->authorize ('view', $application);
127
+        $this->authorize ('update', $application);
128 128
 
129
-        return view(
129
+        return view (
130 130
             'applicant/application_post_02',
131 131
             [
132 132
                 // Application Template Data.
133 133
                 'application_step' => 2,
134
-                'application_template' => Lang::get('applicant/application_template'),
134
+                'application_template' => Lang::get ('applicant/application_template'),
135 135
                 // Job Data.
136 136
                 'job' => $jobPoster,
137 137
                 // Applicant Data.
138 138
                 'applicant' => $applicant,
139 139
                 'job_application' => $application,
140 140
                 // Submission.
141
-                'form_submit_action' => route('job.application.update.2', $jobPoster)
141
+                'form_submit_action' => route ('job.application.update.2', $jobPoster)
142 142
             ]
143 143
         );
144 144
     }
@@ -149,41 +149,41 @@  discard block
 block discarded – undo
149 149
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
150 150
      * @return \Illuminate\Http\Response
151 151
      */
152
-    public function editEssentialSkills(JobPoster $jobPoster)
152
+    public function editEssentialSkills (JobPoster $jobPoster)
153 153
     {
154
-        $applicant = Auth::user()->applicant;
155
-        $application = $this->getApplicationFromJob($jobPoster);
154
+        $applicant = Auth::user ()->applicant;
155
+        $application = $this->getApplicationFromJob ($jobPoster);
156 156
 
157 157
         // Ensure user has permissions to view and update application.
158
-        $this->authorize('view', $application);
159
-        $this->authorize('update', $application);
158
+        $this->authorize ('view', $application);
159
+        $this->authorize ('update', $application);
160 160
 
161 161
         $criteria = [
162
-            'essential' => $jobPoster->criteria->filter(function ($value, $key) {
162
+            'essential' => $jobPoster->criteria->filter (function ($value, $key) {
163 163
                 return $value->criteria_type->name == 'essential';
164 164
             }),
165
-            'asset' => $jobPoster->criteria->filter(function ($value, $key) {
165
+            'asset' => $jobPoster->criteria->filter (function ($value, $key) {
166 166
                 return $value->criteria_type->name == 'asset';
167 167
             }),
168 168
         ];
169 169
 
170
-        return view(
170
+        return view (
171 171
             'applicant/application_post_03',
172 172
             [
173 173
                 // Application Template Data.
174 174
                 'application_step' => 3,
175
-                'application_template' => Lang::get('applicant/application_template'),
175
+                'application_template' => Lang::get ('applicant/application_template'),
176 176
                 // Job Data.
177 177
                 'job' => $jobPoster,
178 178
                 // Skills Data.
179
-                'skills' => Skill::all(),
180
-                'skill_template' => Lang::get('common/skills'),
179
+                'skills' => Skill::all (),
180
+                'skill_template' => Lang::get ('common/skills'),
181 181
                 'criteria' => $criteria,
182 182
                 // Applicant Data.
183 183
                 'applicant' => $applicant,
184 184
                 'job_application' => $application,
185 185
                 // Submission.
186
-                'form_submit_action' => route('job.application.update.3', $jobPoster)
186
+                'form_submit_action' => route ('job.application.update.3', $jobPoster)
187 187
             ]
188 188
         );
189 189
     }
@@ -194,41 +194,41 @@  discard block
 block discarded – undo
194 194
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
195 195
      * @return \Illuminate\Http\Response
196 196
      */
197
-    public function editAssetSkills(JobPoster $jobPoster)
197
+    public function editAssetSkills (JobPoster $jobPoster)
198 198
     {
199
-        $applicant = Auth::user()->applicant;
200
-        $application = $this->getApplicationFromJob($jobPoster);
199
+        $applicant = Auth::user ()->applicant;
200
+        $application = $this->getApplicationFromJob ($jobPoster);
201 201
 
202 202
         // Ensure user has permissions to view and update application.
203
-        $this->authorize('view', $application);
204
-        $this->authorize('update', $application);
203
+        $this->authorize ('view', $application);
204
+        $this->authorize ('update', $application);
205 205
 
206 206
         $criteria = [
207
-            'essential' => $jobPoster->criteria->filter(function ($value, $key) {
207
+            'essential' => $jobPoster->criteria->filter (function ($value, $key) {
208 208
                 return $value->criteria_type->name == 'essential';
209 209
             }),
210
-            'asset' => $jobPoster->criteria->filter(function ($value, $key) {
210
+            'asset' => $jobPoster->criteria->filter (function ($value, $key) {
211 211
                 return $value->criteria_type->name == 'asset';
212 212
             }),
213 213
         ];
214 214
 
215
-        return view(
215
+        return view (
216 216
             'applicant/application_post_04',
217 217
             [
218 218
                 // Application Template Data.
219 219
                 'application_step' => 4,
220
-                'application_template' => Lang::get('applicant/application_template'),
220
+                'application_template' => Lang::get ('applicant/application_template'),
221 221
                 // Job Data.
222 222
                 'job' => $jobPoster,
223 223
                 // Skills Data.
224
-                'skills' => Skill::all(),
225
-                'skill_template' => Lang::get('common/skills'),
224
+                'skills' => Skill::all (),
225
+                'skill_template' => Lang::get ('common/skills'),
226 226
                 'criteria' => $criteria,
227 227
                 // Applicant Data.
228 228
                 'applicant' => $applicant,
229 229
                 'job_application' => $application,
230 230
                 // Submission.
231
-                'form_submit_action' => route('job.application.update.4', $jobPoster)
231
+                'form_submit_action' => route ('job.application.update.4', $jobPoster)
232 232
             ]
233 233
         );
234 234
     }
@@ -239,40 +239,40 @@  discard block
 block discarded – undo
239 239
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
240 240
      * @return \Illuminate\Http\Response
241 241
      */
242
-    public function preview(JobPoster $jobPoster)
242
+    public function preview (JobPoster $jobPoster)
243 243
     {
244
-        $applicant = Auth::user()->applicant;
245
-        $application = $this->getApplicationFromJob($jobPoster);
244
+        $applicant = Auth::user ()->applicant;
245
+        $application = $this->getApplicationFromJob ($jobPoster);
246 246
 
247
-        $this->authorize('view', $application);
247
+        $this->authorize ('view', $application);
248 248
         $criteria = [
249
-            'essential' => $jobPoster->criteria->filter(function ($value, $key) {
249
+            'essential' => $jobPoster->criteria->filter (function ($value, $key) {
250 250
                 return $value->criteria_type->name == 'essential';
251 251
             }),
252
-            'asset' => $jobPoster->criteria->filter(function ($value, $key) {
252
+            'asset' => $jobPoster->criteria->filter (function ($value, $key) {
253 253
                 return $value->criteria_type->name == 'asset';
254 254
             }),
255 255
         ];
256 256
 
257
-        return view(
257
+        return view (
258 258
             'applicant/application_post_05',
259 259
             [
260 260
                 // Application Template Data.
261 261
                 'application_step' => 5,
262
-                'application_template' => Lang::get('applicant/application_template'),
263
-                'preferred_language_template' => Lang::get('common/preferred_language'),
264
-                'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'),
265
-                'veteran_status_template' => Lang::get('common/veteran_status'),
262
+                'application_template' => Lang::get ('applicant/application_template'),
263
+                'preferred_language_template' => Lang::get ('common/preferred_language'),
264
+                'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'),
265
+                'veteran_status_template' => Lang::get ('common/veteran_status'),
266 266
                 // Job Data.
267 267
                 'job' => $jobPoster,
268 268
                 // Skills Data.
269
-                'skills' => Skill::all(),
270
-                'skill_template' => Lang::get('common/skills'),
269
+                'skills' => Skill::all (),
270
+                'skill_template' => Lang::get ('common/skills'),
271 271
                 'criteria' => $criteria,
272 272
                 // Applicant Data.
273 273
                 'applicant' => $applicant,
274 274
                 'job_application' => $application,
275
-                'is_manager_view' => WhichPortal::isManagerPortal(),
275
+                'is_manager_view' => WhichPortal::isManagerPortal (),
276 276
             ]
277 277
         );
278 278
     }
@@ -283,24 +283,24 @@  discard block
 block discarded – undo
283 283
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
284 284
      * @return \Illuminate\Http\Response
285 285
      */
286
-    public function confirm(JobPoster $jobPoster)
286
+    public function confirm (JobPoster $jobPoster)
287 287
     {
288
-        $applicant = Auth::user()->applicant;
289
-        $application = $this->getApplicationFromJob($jobPoster);
288
+        $applicant = Auth::user ()->applicant;
289
+        $application = $this->getApplicationFromJob ($jobPoster);
290 290
 
291
-        $this->authorize('update', $application);
291
+        $this->authorize ('update', $application);
292 292
 
293
-        return view(
293
+        return view (
294 294
             'applicant/application_post_06',
295 295
             [
296 296
                 // Application Template Data.
297 297
                 'application_step' => 6,
298
-                'application_template' => Lang::get('applicant/application_template'),
298
+                'application_template' => Lang::get ('applicant/application_template'),
299 299
                 // Used by tracker partial.
300 300
                 'job' => $jobPoster,
301 301
                 'job_application' => $application,
302 302
                 // Submission.
303
-                'form_submit_action' => route('job.application.submit', $jobPoster)
303
+                'form_submit_action' => route ('job.application.submit', $jobPoster)
304 304
             ]
305 305
         );
306 306
     }
@@ -311,22 +311,22 @@  discard block
 block discarded – undo
311 311
      * @param  \App\Models\JobPoster $jobPoster Incoming Job Poster object.
312 312
      * @return \Illuminate\Http\Response
313 313
      */
314
-    public function complete(JobPoster $jobPoster)
314
+    public function complete (JobPoster $jobPoster)
315 315
     {
316 316
         // Include Applicant Data.
317
-        $applicant = Auth::user()->applicant;
317
+        $applicant = Auth::user ()->applicant;
318 318
         // Include Application Data.
319
-        $application = $this->getApplicationFromJob($jobPoster);
319
+        $application = $this->getApplicationFromJob ($jobPoster);
320 320
 
321 321
         // Ensure user has permissions to view application.
322
-        $this->authorize('view', $application);
322
+        $this->authorize ('view', $application);
323 323
 
324 324
         // Return the Completion View.
325
-        return view(
325
+        return view (
326 326
             'applicant/application_post_complete',
327 327
             [
328 328
                 // Application Template Data.
329
-                'application_template' => Lang::get('applicant/application_template'),
329
+                'application_template' => Lang::get ('applicant/application_template'),
330 330
                 // Job Data.
331 331
                 'job' => $jobPoster,
332 332
                 // Applicant Data.
@@ -343,52 +343,52 @@  discard block
 block discarded – undo
343 343
      * @param  \App\Models\JobPoster    $jobPoster Incoming Job Poster object.
344 344
      * @return \Illuminate\Http\Response
345 345
      */
346
-    public function updateBasics(Request $request, JobPoster $jobPoster)
346
+    public function updateBasics (Request $request, JobPoster $jobPoster)
347 347
     {
348
-        $applicant = Auth::user()->applicant;
349
-        $application = $this->getApplicationFromJob($jobPoster);
348
+        $applicant = Auth::user ()->applicant;
349
+        $application = $this->getApplicationFromJob ($jobPoster);
350 350
 
351 351
         // Ensure user has permissions to update this application.
352
-        $this->authorize('update', $application);
352
+        $this->authorize ('update', $application);
353 353
 
354
-        $application->fill([
355
-            'citizenship_declaration_id' => $request->input('citizenship_declaration_id'),
356
-            'veteran_status_id' => $request->input('veteran_status_id'),
357
-            'preferred_language_id' => $request->input('preferred_language_id'),
358
-            'language_requirement_confirmed' => $request->input('language_requirement_confirmed')
354
+        $application->fill ([
355
+            'citizenship_declaration_id' => $request->input ('citizenship_declaration_id'),
356
+            'veteran_status_id' => $request->input ('veteran_status_id'),
357
+            'preferred_language_id' => $request->input ('preferred_language_id'),
358
+            'language_requirement_confirmed' => $request->input ('language_requirement_confirmed')
359 359
         ]);
360
-        $application->save();
360
+        $application->save ();
361 361
 
362 362
         $questions = $jobPoster->job_poster_questions;
363
-        $questionsInput = $request->input('questions');
363
+        $questionsInput = $request->input ('questions');
364 364
         foreach ($questions as $question) {
365 365
             $answer = null;
366 366
             if (isset($questionsInput[$question->id])) {
367 367
                 $answer = $questionsInput[$question->id];
368 368
             }
369 369
             $answerObj = $application->job_application_answers
370
-            ->firstWhere('job_poster_question_id', $question->id);
370
+            ->firstWhere ('job_poster_question_id', $question->id);
371 371
             if ($answerObj == null) {
372
-                $answerObj = new JobApplicationAnswer();
372
+                $answerObj = new JobApplicationAnswer ();
373 373
                 $answerObj->job_poster_question_id = $question->id;
374 374
                 $answerObj->job_application_id = $application->id;
375 375
             }
376 376
             $answerObj->answer = $answer;
377
-            $answerObj->save();
377
+            $answerObj->save ();
378 378
         }
379 379
 
380 380
         // Redirect to correct page.
381
-        switch ($request->input('submit')) {
381
+        switch ($request->input ('submit')) {
382 382
             case 'save_and_quit':
383 383
             case 'previous':
384
-                return redirect()->route('applications.index');
384
+                return redirect ()->route ('applications.index');
385 385
                 break;
386 386
             case 'save_and_continue':
387 387
             case 'next':
388
-                return redirect()->route('job.application.edit.2', $jobPoster);
388
+                return redirect ()->route ('job.application.edit.2', $jobPoster);
389 389
                 break;
390 390
             default:
391
-                return redirect()->back()->withInput();
391
+                return redirect ()->back ()->withInput ();
392 392
         }
393 393
     }
394 394
 
@@ -399,21 +399,21 @@  discard block
 block discarded – undo
399 399
      * @param  \App\Models\JobPoster    $jobPoster Incoming Job Poster object.
400 400
      * @return \Illuminate\Http\Response
401 401
      */
402
-    public function updateExperience(Request $request, JobPoster $jobPoster)
402
+    public function updateExperience (Request $request, JobPoster $jobPoster)
403 403
     {
404
-        $applicant = Auth::user()->applicant;
405
-        $application = $this->getApplicationFromJob($jobPoster);
404
+        $applicant = Auth::user ()->applicant;
405
+        $application = $this->getApplicationFromJob ($jobPoster);
406 406
 
407 407
         // Ensure user has permissions to update this application.
408
-        $this->authorize('update', $application);
408
+        $this->authorize ('update', $application);
409 409
 
410 410
         // Record that the user has saved their experience for this application.
411 411
         $application->experience_saved = true;
412
-        $application->save();
412
+        $application->save ();
413 413
 
414
-        $degrees = $request->input('degrees');
414
+        $degrees = $request->input ('degrees');
415 415
 
416
-        $request->validate([
416
+        $request->validate ([
417 417
             'degrees.new.*.degree_type_id' => 'required',
418 418
             'degrees.new.*.area_of_study'  => 'required',
419 419
             'degrees.new.*.institution'    => 'required',
@@ -426,9 +426,9 @@  discard block
 block discarded – undo
426 426
         // Save new degrees.
427 427
         if (isset($degrees['new'])) {
428 428
             foreach ($degrees['new'] as $degreeInput) {
429
-                $degree = new Degree();
429
+                $degree = new Degree ();
430 430
                 $degree->applicant_id = $applicant->id;
431
-                $degree->fill([
431
+                $degree->fill ([
432 432
                     'degree_type_id' => $degreeInput['degree_type_id'],
433 433
                     'area_of_study' => $degreeInput['area_of_study'],
434 434
                     'institution' => $degreeInput['institution'],
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
                     'end_date' => $degreeInput['end_date'],
438 438
                     'blockcert_url' => $degreeInput['blockcert_url'],
439 439
                 ]);
440
-                $degree->save();
440
+                $degree->save ();
441 441
             }
442 442
         }
443 443
 
@@ -445,9 +445,9 @@  discard block
 block discarded – undo
445 445
         if (isset($degrees['old'])) {
446 446
             foreach ($degrees['old'] as $id => $degreeInput) {
447 447
                 // Ensure this degree belongs to this applicant.
448
-                $degree = $applicant->degrees->firstWhere('id', $id);
448
+                $degree = $applicant->degrees->firstWhere ('id', $id);
449 449
                 if ($degree != null) {
450
-                    $degree->fill([
450
+                    $degree->fill ([
451 451
                         'degree_type_id' => $degreeInput['degree_type_id'],
452 452
                         'area_of_study' => $degreeInput['area_of_study'],
453 453
                         'institution' => $degreeInput['institution'],
@@ -456,16 +456,16 @@  discard block
 block discarded – undo
456 456
                         'end_date' => $degreeInput['end_date'],
457 457
                         'blockcert_url' => $degreeInput['blockcert_url'],
458 458
                     ]);
459
-                    $degree->save();
459
+                    $degree->save ();
460 460
                 } else {
461
-                    Log::warning("Applicant $applicant->id attempted to update degree with invalid id: $id");
461
+                    Log::warning ("Applicant $applicant->id attempted to update degree with invalid id: $id");
462 462
                 }
463 463
             }
464 464
         }
465 465
 
466
-        $courses = $request->input('courses');
466
+        $courses = $request->input ('courses');
467 467
 
468
-        $request->validate([
468
+        $request->validate ([
469 469
             'courses.new.*.name'             => 'required',
470 470
             'courses.new.*.institution'      => 'required',
471 471
             'courses.new.*.course_status_id' => 'required',
@@ -476,16 +476,16 @@  discard block
 block discarded – undo
476 476
         // Save new courses.
477 477
         if (isset($courses['new'])) {
478 478
             foreach ($courses['new'] as $courseInput) {
479
-                $course = new Course();
479
+                $course = new Course ();
480 480
                 $course->applicant_id = $applicant->id;
481
-                $course->fill([
481
+                $course->fill ([
482 482
                     'name' => $courseInput['name'],
483 483
                     'institution' => $courseInput['institution'],
484 484
                     'course_status_id' => $courseInput['course_status_id'],
485 485
                     'start_date' => $courseInput['start_date'],
486 486
                     'end_date' => $courseInput['end_date']
487 487
                 ]);
488
-                $course->save();
488
+                $course->save ();
489 489
             }
490 490
         }
491 491
 
@@ -493,25 +493,25 @@  discard block
 block discarded – undo
493 493
         if (isset($courses['old'])) {
494 494
             foreach ($courses['old'] as $id => $courseInput) {
495 495
                 // Ensure this course belongs to this applicant.
496
-                $course = $applicant->courses->firstWhere('id', $id);
496
+                $course = $applicant->courses->firstWhere ('id', $id);
497 497
                 if ($course != null) {
498
-                    $course->fill([
498
+                    $course->fill ([
499 499
                         'name' => $courseInput['name'],
500 500
                         'institution' => $courseInput['institution'],
501 501
                         'course_status_id' => $courseInput['course_status_id'],
502 502
                         'start_date' => $courseInput['start_date'],
503 503
                         'end_date' => $courseInput['end_date']
504 504
                     ]);
505
-                    $course->save();
505
+                    $course->save ();
506 506
                 } else {
507
-                    Log::warning("Applicant $applicant->id attempted to update course with invalid id: $id");
507
+                    Log::warning ("Applicant $applicant->id attempted to update course with invalid id: $id");
508 508
                 }
509 509
             }
510 510
         }
511 511
 
512
-        $work_experiences = $request->input('work_experiences');
512
+        $work_experiences = $request->input ('work_experiences');
513 513
 
514
-        $request->validate([
514
+        $request->validate ([
515 515
             'work_experiences.new.*.role'        => 'required',
516 516
             'work_experiences.new.*.company'     => 'required',
517 517
             'work_experiences.new.*.description' => 'required',
@@ -522,16 +522,16 @@  discard block
 block discarded – undo
522 522
         // Save new work_experiences.
523 523
         if (isset($work_experiences['new'])) {
524 524
             foreach ($work_experiences['new'] as $workExperienceInput) {
525
-                $workExperience = new WorkExperience();
525
+                $workExperience = new WorkExperience ();
526 526
                 $workExperience->applicant_id = $applicant->id;
527
-                $workExperience->fill([
527
+                $workExperience->fill ([
528 528
                     'role' => $workExperienceInput['role'],
529 529
                     'company' => $workExperienceInput['company'],
530 530
                     'description' => $workExperienceInput['description'],
531 531
                     'start_date' => $workExperienceInput['start_date'],
532 532
                     'end_date' => $workExperienceInput['end_date']
533 533
                 ]);
534
-                $workExperience->save();
534
+                $workExperience->save ();
535 535
             }
536 536
         }
537 537
 
@@ -539,36 +539,36 @@  discard block
 block discarded – undo
539 539
         if (isset($work_experiences['old'])) {
540 540
             foreach ($work_experiences['old'] as $id => $workExperienceInput) {
541 541
                 // Ensure this work_experience belongs to this applicant.
542
-                $workExperience = $applicant->work_experiences->firstWhere('id', $id);
542
+                $workExperience = $applicant->work_experiences->firstWhere ('id', $id);
543 543
                 if ($workExperience != null) {
544
-                    $workExperience->fill([
544
+                    $workExperience->fill ([
545 545
                         'role' => $workExperienceInput['role'],
546 546
                         'company' => $workExperienceInput['company'],
547 547
                         'description' => $workExperienceInput['description'],
548 548
                         'start_date' => $workExperienceInput['start_date'],
549 549
                         'end_date' => $workExperienceInput['end_date']
550 550
                     ]);
551
-                    $workExperience->save();
551
+                    $workExperience->save ();
552 552
                 } else {
553
-                    Log::warning("Applicant $applicant->id attempted to update work_experience with invalid id: $id");
553
+                    Log::warning ("Applicant $applicant->id attempted to update work_experience with invalid id: $id");
554 554
                 }
555 555
             }
556 556
         }
557 557
 
558 558
         // Redirect to correct page.
559
-        switch ($request->input('submit')) {
559
+        switch ($request->input ('submit')) {
560 560
             case 'save_and_quit':
561
-                return redirect()->route('applications.index');
561
+                return redirect ()->route ('applications.index');
562 562
                 break;
563 563
             case 'save_and_continue':
564 564
             case 'next':
565
-                return redirect()->route('job.application.edit.3', $jobPoster);
565
+                return redirect ()->route ('job.application.edit.3', $jobPoster);
566 566
                 break;
567 567
             case 'previous':
568
-                return redirect()->route('job.application.edit.1', $jobPoster);
568
+                return redirect ()->route ('job.application.edit.1', $jobPoster);
569 569
                 break;
570 570
             default:
571
-                return redirect()->back()->withInput();
571
+                return redirect ()->back ()->withInput ();
572 572
         }
573 573
     }
574 574
 
@@ -579,36 +579,36 @@  discard block
 block discarded – undo
579 579
      * @param  \App\Models\JobPoster    $jobPoster Incoming Job Poster object.
580 580
      * @return \Illuminate\Http\Response
581 581
      */
582
-    public function updateEssentialSkills(Request $request, JobPoster $jobPoster)
582
+    public function updateEssentialSkills (Request $request, JobPoster $jobPoster)
583 583
     {
584
-        $applicant = Auth::user()->applicant;
585
-        $application = $this->getApplicationFromJob($jobPoster);
584
+        $applicant = Auth::user ()->applicant;
585
+        $application = $this->getApplicationFromJob ($jobPoster);
586 586
 
587 587
         // Ensure user has permissions to update this application.
588
-        $this->authorize('update', $application);
588
+        $this->authorize ('update', $application);
589 589
 
590
-        $skillDeclarations = $request->input('skill_declarations');
591
-        $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id;
590
+        $skillDeclarations = $request->input ('skill_declarations');
591
+        $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id;
592 592
 
593 593
         // Save new skill declarartions.
594 594
         if (isset($skillDeclarations['new'])) {
595 595
             foreach ($skillDeclarations['new'] as $skillType => $typeInput) {
596 596
                 foreach ($typeInput as $criterion_id => $skillDeclarationInput) {
597
-                    $skillDeclaration = new SkillDeclaration();
597
+                    $skillDeclaration = new SkillDeclaration ();
598 598
                     $skillDeclaration->applicant_id = $applicant->id;
599
-                    $skillDeclaration->skill_id = Criteria::find($criterion_id)->skill->id;
599
+                    $skillDeclaration->skill_id = Criteria::find ($criterion_id)->skill->id;
600 600
                     $skillDeclaration->skill_status_id = $claimedStatusId;
601
-                    $skillDeclaration->fill([
601
+                    $skillDeclaration->fill ([
602 602
                         'description' => $skillDeclarationInput['description'],
603 603
                         'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
604 604
                     ]);
605
-                    $skillDeclaration->save();
605
+                    $skillDeclaration->save ();
606 606
 
607
-                    $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
608
-                    $skillDeclaration->references()->sync($referenceIds);
607
+                    $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
608
+                    $skillDeclaration->references ()->sync ($referenceIds);
609 609
 
610
-                    $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
611
-                    $skillDeclaration->work_samples()->sync($sampleIds);
610
+                    $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
611
+                    $skillDeclaration->work_samples ()->sync ($sampleIds);
612 612
                 }
613 613
             }
614 614
         }
@@ -618,41 +618,41 @@  discard block
 block discarded – undo
618 618
             foreach ($skillDeclarations['old'] as $skillType => $typeInput) {
619 619
                 foreach ($typeInput as $id => $skillDeclarationInput) {
620 620
                     // Ensure this declaration belongs to this applicant.
621
-                    $skillDeclaration = $applicant->skill_declarations->firstWhere('id', $id);
621
+                    $skillDeclaration = $applicant->skill_declarations->firstWhere ('id', $id);
622 622
                     if ($skillDeclaration != null) {
623 623
                         // skill_id and skill_status cannot be changed.
624
-                        $skillDeclaration->fill([
624
+                        $skillDeclaration->fill ([
625 625
                             'description' => $skillDeclarationInput['description'],
626 626
                             'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
627 627
                         ]);
628
-                        $skillDeclaration->save();
628
+                        $skillDeclaration->save ();
629 629
 
630
-                        $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
631
-                        $skillDeclaration->references()->sync($referenceIds);
630
+                        $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
631
+                        $skillDeclaration->references ()->sync ($referenceIds);
632 632
 
633
-                        $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
634
-                        $skillDeclaration->work_samples()->sync($sampleIds);
633
+                        $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
634
+                        $skillDeclaration->work_samples ()->sync ($sampleIds);
635 635
                     } else {
636
-                        Log::warning("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
636
+                        Log::warning ("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
637 637
                     }
638 638
                 }
639 639
             }
640 640
         }
641 641
 
642 642
         // Redirect to correct page.
643
-        switch ($request->input('submit')) {
643
+        switch ($request->input ('submit')) {
644 644
             case 'save_and_quit':
645
-                return redirect()->route('applications.index');
645
+                return redirect ()->route ('applications.index');
646 646
                 break;
647 647
             case 'save_and_continue':
648 648
             case 'next':
649
-                return redirect()->route('job.application.edit.4', $jobPoster);
649
+                return redirect ()->route ('job.application.edit.4', $jobPoster);
650 650
                 break;
651 651
             case 'previous':
652
-                return redirect()->route('job.application.edit.2', $jobPoster);
652
+                return redirect ()->route ('job.application.edit.2', $jobPoster);
653 653
                 break;
654 654
             default:
655
-                return redirect()->back()->withInput();
655
+                return redirect ()->back ()->withInput ();
656 656
         }
657 657
     }
658 658
 
@@ -663,36 +663,36 @@  discard block
 block discarded – undo
663 663
      * @param  \App\Models\JobPoster    $jobPoster Incoming Job Poster object.
664 664
      * @return \Illuminate\Http\Response
665 665
      */
666
-    public function updateAssetSkills(Request $request, JobPoster $jobPoster)
666
+    public function updateAssetSkills (Request $request, JobPoster $jobPoster)
667 667
     {
668
-        $applicant = Auth::user()->applicant;
669
-        $application = $this->getApplicationFromJob($jobPoster);
668
+        $applicant = Auth::user ()->applicant;
669
+        $application = $this->getApplicationFromJob ($jobPoster);
670 670
 
671 671
         // Ensure user has permissions to update this application.
672
-        $this->authorize('update', $application);
672
+        $this->authorize ('update', $application);
673 673
 
674
-        $skillDeclarations = $request->input('skill_declarations');
675
-        $claimedStatusId = SkillStatus::where('name', 'claimed')->firstOrFail()->id;
674
+        $skillDeclarations = $request->input ('skill_declarations');
675
+        $claimedStatusId = SkillStatus::where ('name', 'claimed')->firstOrFail ()->id;
676 676
 
677 677
         // Save new skill declarartions.
678 678
         if (isset($skillDeclarations['new'])) {
679 679
             foreach ($skillDeclarations['new'] as $skillType => $typeInput) {
680 680
                 foreach ($typeInput as $criterion_id => $skillDeclarationInput) {
681
-                    $skillDeclaration = new SkillDeclaration();
681
+                    $skillDeclaration = new SkillDeclaration ();
682 682
                     $skillDeclaration->applicant_id = $applicant->id;
683
-                    $skillDeclaration->skill_id = Criteria::find($criterion_id)->skill->id;
683
+                    $skillDeclaration->skill_id = Criteria::find ($criterion_id)->skill->id;
684 684
                     $skillDeclaration->skill_status_id = $claimedStatusId;
685
-                    $skillDeclaration->fill([
685
+                    $skillDeclaration->fill ([
686 686
                         'description' => $skillDeclarationInput['description'],
687 687
                         'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
688 688
                     ]);
689
-                    $skillDeclaration->save();
689
+                    $skillDeclaration->save ();
690 690
 
691
-                    $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
692
-                    $skillDeclaration->references()->sync($referenceIds);
691
+                    $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
692
+                    $skillDeclaration->references ()->sync ($referenceIds);
693 693
 
694
-                    $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
695
-                    $skillDeclaration->work_samples()->sync($sampleIds);
694
+                    $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
695
+                    $skillDeclaration->work_samples ()->sync ($sampleIds);
696 696
                 }
697 697
             }
698 698
         }
@@ -702,41 +702,41 @@  discard block
 block discarded – undo
702 702
             foreach ($skillDeclarations['old'] as $skillType => $typeInput) {
703 703
                 foreach ($typeInput as $id => $skillDeclarationInput) {
704 704
                     // Ensure this declaration belongs to this applicant.
705
-                    $skillDeclaration = $applicant->skill_declarations->firstWhere('id', $id);
705
+                    $skillDeclaration = $applicant->skill_declarations->firstWhere ('id', $id);
706 706
                     if ($skillDeclaration != null) {
707 707
                         // skill_id and skill_status cannot be changed.
708
-                        $skillDeclaration->fill([
708
+                        $skillDeclaration->fill ([
709 709
                             'description' => $skillDeclarationInput['description'],
710 710
                             'skill_level_id' => isset($skillDeclarationInput['skill_level_id']) ? $skillDeclarationInput['skill_level_id'] : null,
711 711
                         ]);
712
-                        $skillDeclaration->save();
712
+                        $skillDeclaration->save ();
713 713
 
714
-                        $referenceIds = $this->getRelativeIds($skillDeclarationInput, 'references');
715
-                        $skillDeclaration->references()->sync($referenceIds);
714
+                        $referenceIds = $this->getRelativeIds ($skillDeclarationInput, 'references');
715
+                        $skillDeclaration->references ()->sync ($referenceIds);
716 716
 
717
-                        $sampleIds = $this->getRelativeIds($skillDeclarationInput, 'samples');
718
-                        $skillDeclaration->work_samples()->sync($sampleIds);
717
+                        $sampleIds = $this->getRelativeIds ($skillDeclarationInput, 'samples');
718
+                        $skillDeclaration->work_samples ()->sync ($sampleIds);
719 719
                     } else {
720
-                        Log::warning("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
720
+                        Log::warning ("Applicant $applicant->id attempted to update skill declaration with invalid id: $id");
721 721
                     }
722 722
                 }
723 723
             }
724 724
         }
725 725
 
726 726
         // Redirect to correct page.
727
-        switch ($request->input('submit')) {
727
+        switch ($request->input ('submit')) {
728 728
             case 'save_and_quit':
729
-                return redirect()->route('applications.index');
729
+                return redirect ()->route ('applications.index');
730 730
                 break;
731 731
             case 'save_and_continue':
732 732
             case 'next':
733
-                return redirect()->route('job.application.edit.5', $jobPoster);
733
+                return redirect ()->route ('job.application.edit.5', $jobPoster);
734 734
                 break;
735 735
             case 'previous':
736
-                return redirect()->route('job.application.edit.3', $jobPoster);
736
+                return redirect ()->route ('job.application.edit.3', $jobPoster);
737 737
                 break;
738 738
             default:
739
-                return redirect()->back()->withInput();
739
+                return redirect ()->back ()->withInput ();
740 740
         }
741 741
     }
742 742
 
@@ -747,17 +747,17 @@  discard block
 block discarded – undo
747 747
      * @param  \App\Models\JobPoster    $jobPoster Incoming Job Poster object.
748 748
      * @return \Illuminate\Http\Response
749 749
      */
750
-    public function submit(Request $request, JobPoster $jobPoster)
750
+    public function submit (Request $request, JobPoster $jobPoster)
751 751
     {
752
-        $applicant = Auth::user()->applicant;
753
-        $application = $this->getApplicationFromJob($jobPoster);
752
+        $applicant = Auth::user ()->applicant;
753
+        $application = $this->getApplicationFromJob ($jobPoster);
754 754
 
755 755
         // Ensure user has permissions to update this application.
756
-        $this->authorize('update', $application);
756
+        $this->authorize ('update', $application);
757 757
 
758 758
         // Only complete submission if submit button was pressed.
759
-        if ($request->input('submit') == 'submit') {
760
-            $request->validate([
759
+        if ($request->input ('submit') == 'submit') {
760
+            $request->validate ([
761 761
                 'submission_signature' => [
762 762
                     'required',
763 763
                     'string',
@@ -771,33 +771,33 @@  discard block
 block discarded – undo
771 771
             ]);
772 772
 
773 773
             // Save any final info.
774
-            $application->fill([
775
-                'submission_signature' => $request->input('submission_signature'),
776
-                'submission_date' => $request->input('submission_date'),
774
+            $application->fill ([
775
+                'submission_signature' => $request->input ('submission_signature'),
776
+                'submission_date' => $request->input ('submission_date'),
777 777
             ]);
778 778
 
779
-            $validator = new ApplicationValidator();
780
-            $validator->validate($application);
779
+            $validator = new ApplicationValidator ();
780
+            $validator->validate ($application);
781 781
 
782 782
             // Change status to 'submitted'.
783
-            $application->application_status_id = ApplicationStatus::where('name', 'submitted')->firstOrFail()->id;
783
+            $application->application_status_id = ApplicationStatus::where ('name', 'submitted')->firstOrFail ()->id;
784 784
         }
785 785
 
786
-        $application->save();
786
+        $application->save ();
787 787
 
788 788
         // Redirect to correct page.
789
-        switch ($request->input('submit')) {
789
+        switch ($request->input ('submit')) {
790 790
             case 'save_and_quit':
791
-                return redirect()->route('applications.index');
791
+                return redirect ()->route ('applications.index');
792 792
                 break;
793 793
             case 'submit':
794
-                return redirect()->route('job.application.complete', $jobPoster);
794
+                return redirect ()->route ('job.application.complete', $jobPoster);
795 795
                 break;
796 796
             case 'previous':
797
-                return redirect()->route('job.application.edit.4', $jobPoster);
797
+                return redirect ()->route ('job.application.edit.4', $jobPoster);
798 798
                 break;
799 799
             default:
800
-                return redirect()->back()->withInput();
800
+                return redirect ()->back ()->withInput ();
801 801
         }
802 802
     }
803 803
 }
Please login to merge, or discard this patch.
app/Http/Controllers/SkillDeclarationController.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
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.skills.edit', $applicant));
24
+        $applicant = $request->user ()->applicant;
25
+        return redirect (route ('profile.skills.edit', $applicant));
26 26
     }
27 27
 
28 28
     /**
@@ -32,18 +32,18 @@  discard block
 block discarded – undo
32 32
      * @param  \App\Models\Applicant    $applicant 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
-        $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
 
@@ -53,25 +53,25 @@  discard block
 block discarded – undo
53 53
      * @param  \Illuminate\Http\Request $request Incoming request.
54 54
      * @return \Illuminate\Http\Response|string
55 55
      */
56
-    public function create(Request $request)
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
     /**
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
      * @param  \App\Models\SkillDeclaration $skillDeclaration Incoming Skill Declaration.
82 82
      * @return \Illuminate\Http\Response|string
83 83
      */
84
-    public function update(Request $request, SkillDeclaration $skillDeclaration)
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
     /**
@@ -95,38 +95,38 @@  discard block
 block discarded – undo
95 95
      * @param  \App\Models\SkillDeclaration $skillDeclaration Incoming Skill Declaration.
96 96
      * @return \Illuminate\Http\Response|string
97 97
      */
98
-    protected function updateSkillDeclaration(Request $request, SkillDeclaration $skillDeclaration)
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
     /**
@@ -136,15 +136,15 @@  discard block
 block discarded – undo
136 136
      * @param  \App\Models\SkillDeclaration $skillDeclaration Incoming Skill Declaration.
137 137
      * @return \Illuminate\Http\Response|string[]
138 138
      */
139
-    public function destroy(Request $request, SkillDeclaration $skillDeclaration)
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
 }
Please login to merge, or discard this patch.
app/Http/Controllers/ReferencesController.php 1 patch
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -19,10 +19,10 @@  discard block
 block discarded – undo
19 19
      * @param  \Illuminate\Http\Request $request Incoming request object.
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.references.edit', $applicant));
24
+        $applicant = $request->user ()->applicant;
25
+        return redirect (route ('profile.references.edit', $applicant));
26 26
     }
27 27
 
28 28
     /**
@@ -32,16 +32,16 @@  discard block
 block discarded – undo
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
-        $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
 
@@ -52,56 +52,56 @@  discard block
 block discarded – undo
52 52
      * @param  \App\Models\Reference|null $reference The reference to update. If null, a new one should be created.
53 53
      * @return \Illuminate\Http\Response
54 54
      */
55
-    public function update(Request $request, ?Reference $reference = null)
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
 
@@ -112,21 +112,21 @@  discard block
 block discarded – undo
112 112
      * @param  \App\Models\Reference    $reference Incoming Reference.
113 113
      * @return \Illuminate\Http\Response
114 114
      */
115
-    public function destroy(Request $request, Reference $reference)
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
 }
Please login to merge, or discard this patch.
routes/web.php 1 patch
Spacing   +251 added lines, -251 removed lines patch added patch discarded remove patch
@@ -13,433 +13,433 @@  discard block
 block discarded – undo
13 13
 |
14 14
  */
15 15
 
16
-Route::group(
16
+Route::group (
17 17
     [
18
-        'prefix' => LaravelLocalization::setLocale(),
18
+        'prefix' => LaravelLocalization::setLocale (),
19 19
         'middleware' => ['localeSessionRedirect', 'localizationRedirect', 'localeViewPath']
20 20
     ],
21 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
-            Route::view('blog', 'common/blog-index')->middleware('localOnly')->name('blog');
27
+            Route::view ('blog', 'common/blog-index')->middleware ('localOnly')->name ('blog');
28 28
 
29 29
             /* Temporary Blog Post */
30
-            Route::view('post', 'common/blog-post')->middleware('localOnly')->name('post');
30
+            Route::view ('post', 'common/blog-post')->middleware ('localOnly')->name ('post');
31 31
 
32 32
             /* Static - Reliability Form Demo */
33
-            Route::view('reliability', 'demos/reliability/index', ['reliability' => Lang::get('common/reliability')])->name('reliability');
33
+            Route::view ('reliability', 'demos/reliability/index', ['reliability' => Lang::get ('common/reliability')])->name ('reliability');
34 34
 
35 35
             // /* Temp Builder 01 (Intro) */
36
-            Route::view('builder-01', 'manager/builder-01')->middleware('localOnly')->name('jpb1');
36
+            Route::view ('builder-01', 'manager/builder-01')->middleware ('localOnly')->name ('jpb1');
37 37
             // /* Temp Builder 02 (Job info) */
38
-            Route::view('builder-02', 'manager/builder-02')->middleware('localOnly')->name('jpb2');
38
+            Route::view ('builder-02', 'manager/builder-02')->middleware ('localOnly')->name ('jpb2');
39 39
             // /* Temp Builder 03 (Work Environment) */
40
-            Route::view('builder-03', 'manager/builder-03')->middleware('localOnly')->name('jpb3');
40
+            Route::view ('builder-03', 'manager/builder-03')->middleware ('localOnly')->name ('jpb3');
41 41
             // /* Temp Builder 04 (Impact) */
42
-            Route::view('builder-04', 'manager/builder-04')->middleware('localOnly')->name('jpb4');
42
+            Route::view ('builder-04', 'manager/builder-04')->middleware ('localOnly')->name ('jpb4');
43 43
             // /* Temp Builder 05 (Tasks) */
44
-            Route::view('builder-05', 'manager/builder-05')->middleware('localOnly')->name('jpb5');
44
+            Route::view ('builder-05', 'manager/builder-05')->middleware ('localOnly')->name ('jpb5');
45 45
             // /* Temp Builder 06 (Skills) */
46
-            Route::view('builder-06', 'manager/builder-06')->middleware('localOnly')->name('jpb6');
46
+            Route::view ('builder-06', 'manager/builder-06')->middleware ('localOnly')->name ('jpb6');
47 47
             // /* Temp Builder 07 (Education) */
48
-            Route::view('builder-07', 'manager/builder-07')->middleware('localOnly')->name('jpb7');
48
+            Route::view ('builder-07', 'manager/builder-07')->middleware ('localOnly')->name ('jpb7');
49 49
             // /* Temp Builder 08 (Review) */
50
-            Route::view('builder-08', 'manager/builder-08')->middleware('localOnly')->name('jpb8');
50
+            Route::view ('builder-08', 'manager/builder-08')->middleware ('localOnly')->name ('jpb8');
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
-            Route::get('/', 'HomepageController@applicant')->name('home');
57
+            Route::get ('/', 'HomepageController@applicant')->name ('home');
58 58
 
59 59
             /* Jobs */
60
-            Route::get('jobs', 'JobController@index')->name('jobs.index');
60
+            Route::get ('jobs', 'JobController@index')->name ('jobs.index');
61 61
 
62
-            Route::get('jobs/{jobPoster}', 'JobController@show')
63
-                ->middleware('can:view,jobPoster')
64
-                ->name('jobs.show');
62
+            Route::get ('jobs/{jobPoster}', 'JobController@show')
63
+                ->middleware ('can:view,jobPoster')
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
-                Route::get('managers/{manager}', 'ManagerProfileController@show')
70
-                    ->middleware('can:view,manager')
71
-                    ->name('managers.show');
69
+                Route::get ('managers/{manager}', 'ManagerProfileController@show')
70
+                    ->middleware ('can:view,manager')
71
+                    ->name ('managers.show');
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 */
79
-                Route::get('applications', 'ApplicationController@index')->name('applications.index');
79
+                Route::get ('applications', 'ApplicationController@index')->name ('applications.index');
80 80
 
81 81
                 /* View Application */
82
-                Route::get('applications/{application}', 'ApplicationController@show')
83
-                    ->middleware('can:view,application')
84
-                    ->name('applications.show');
82
+                Route::get ('applications/{application}', 'ApplicationController@show')
83
+                    ->middleware ('can:view,application')
84
+                    ->name ('applications.show');
85 85
 
86 86
                 /* Step 01 */
87
-                Route::get('jobs/{jobPoster}/application/step-01', 'ApplicationByJobController@editBasics')->name('job.application.edit.1');
87
+                Route::get ('jobs/{jobPoster}/application/step-01', 'ApplicationByJobController@editBasics')->name ('job.application.edit.1');
88 88
 
89 89
                 /* Step 02 */
90
-                Route::get('jobs/{jobPoster}/application/step-02', 'ApplicationByJobController@editExperience')->name('job.application.edit.2');
90
+                Route::get ('jobs/{jobPoster}/application/step-02', 'ApplicationByJobController@editExperience')->name ('job.application.edit.2');
91 91
 
92 92
                 /* Step 03 */
93
-                Route::get('jobs/{jobPoster}/application/step-03', 'ApplicationByJobController@editEssentialSkills')->name('job.application.edit.3');
93
+                Route::get ('jobs/{jobPoster}/application/step-03', 'ApplicationByJobController@editEssentialSkills')->name ('job.application.edit.3');
94 94
 
95 95
                 /* Step 04 */
96
-                Route::get('jobs/{jobPoster}/application/step-04', 'ApplicationByJobController@editAssetSkills')->name('job.application.edit.4');
96
+                Route::get ('jobs/{jobPoster}/application/step-04', 'ApplicationByJobController@editAssetSkills')->name ('job.application.edit.4');
97 97
 
98 98
                 /* Step 05 */
99
-                Route::get('jobs/{jobPoster}/application/step-05', 'ApplicationByJobController@preview')->name('job.application.edit.5');
99
+                Route::get ('jobs/{jobPoster}/application/step-05', 'ApplicationByJobController@preview')->name ('job.application.edit.5');
100 100
 
101 101
                 /* Step 06 */
102
-                Route::get('jobs/{jobPoster}/application/step-06', 'ApplicationByJobController@confirm')->name('job.application.edit.6');
102
+                Route::get ('jobs/{jobPoster}/application/step-06', 'ApplicationByJobController@confirm')->name ('job.application.edit.6');
103 103
 
104 104
                 /* Step 06: Complete */
105
-                Route::get('jobs/{jobPoster}/application/complete', 'ApplicationByJobController@complete')->name('job.application.complete');
105
+                Route::get ('jobs/{jobPoster}/application/complete', 'ApplicationByJobController@complete')->name ('job.application.complete');
106 106
 
107 107
                 /* Application Update routes */
108 108
 
109 109
                 /* Step 01 */
110
-                Route::post('jobs/{jobPoster}/application/step-01/update', 'ApplicationByJobController@updateBasics')->name('job.application.update.1');
110
+                Route::post ('jobs/{jobPoster}/application/step-01/update', 'ApplicationByJobController@updateBasics')->name ('job.application.update.1');
111 111
 
112 112
                 /* Step 02 */
113
-                Route::post('jobs/{jobPoster}/application/step-02/update', 'ApplicationByJobController@updateExperience')->name('job.application.update.2');
113
+                Route::post ('jobs/{jobPoster}/application/step-02/update', 'ApplicationByJobController@updateExperience')->name ('job.application.update.2');
114 114
 
115 115
                 /* Step 03 */
116
-                Route::post('jobs/{jobPoster}/application/step-03/update', 'ApplicationByJobController@updateEssentialSkills')->name('job.application.update.3');
116
+                Route::post ('jobs/{jobPoster}/application/step-03/update', 'ApplicationByJobController@updateEssentialSkills')->name ('job.application.update.3');
117 117
 
118 118
                 /* Step 04 */
119
-                Route::post('jobs/{jobPoster}/application/step-04/update', 'ApplicationByJobController@updateAssetSkills')->name('job.application.update.4');
119
+                Route::post ('jobs/{jobPoster}/application/step-04/update', 'ApplicationByJobController@updateAssetSkills')->name ('job.application.update.4');
120 120
 
121 121
                 /* Step 05 */
122
-                Route::post('jobs/{jobPoster}/application/submit', 'ApplicationByJobController@submit')->name('job.application.submit');
122
+                Route::post ('jobs/{jobPoster}/application/submit', 'ApplicationByJobController@submit')->name ('job.application.submit');
123 123
 
124
-                Route::get('profile', 'ApplicantProfileController@editAuthenticated')->name('profile');
125
-                Route::get('profile/about', 'ApplicantProfileController@editAuthenticated');
124
+                Route::get ('profile', 'ApplicantProfileController@editAuthenticated')->name ('profile');
125
+                Route::get ('profile/about', 'ApplicantProfileController@editAuthenticated');
126 126
 
127 127
                 /* Profile - About Me */
128
-                Route::get('profile/{applicant}/about', 'ApplicantProfileController@edit')
129
-                    ->middleware('can:view,applicant')
130
-                    ->middleware('can:update,applicant')
131
-                    ->name('profile.about.edit');
128
+                Route::get ('profile/{applicant}/about', 'ApplicantProfileController@edit')
129
+                    ->middleware ('can:view,applicant')
130
+                    ->middleware ('can:update,applicant')
131
+                    ->name ('profile.about.edit');
132 132
 
133
-                Route::post('profile/{applicant}/about/update', 'ApplicantProfileController@update')
134
-                    ->middleware('can:update,applicant')
135
-                    ->name('profile.about.update');
133
+                Route::post ('profile/{applicant}/about/update', 'ApplicantProfileController@update')
134
+                    ->middleware ('can:update,applicant')
135
+                    ->name ('profile.about.update');
136 136
 
137 137
                 /* Profile - My Experience */
138
-                Route::get('profile/experience', 'ExperienceController@editAuthenticated');
138
+                Route::get ('profile/experience', 'ExperienceController@editAuthenticated');
139 139
 
140
-                Route::get('profile/{applicant}/experience', 'ExperienceController@edit')
141
-                    ->middleware('can:view,applicant')
142
-                    ->middleware('can:update,applicant')
143
-                    ->name('profile.experience.edit');
140
+                Route::get ('profile/{applicant}/experience', 'ExperienceController@edit')
141
+                    ->middleware ('can:view,applicant')
142
+                    ->middleware ('can:update,applicant')
143
+                    ->name ('profile.experience.edit');
144 144
 
145
-                Route::post('profile/{applicant}/experience/update', 'ExperienceController@update')
146
-                    ->middleware('can:update,applicant')
147
-                    ->name('profile.experience.update');
145
+                Route::post ('profile/{applicant}/experience/update', 'ExperienceController@update')
146
+                    ->middleware ('can:update,applicant')
147
+                    ->name ('profile.experience.update');
148 148
 
149 149
                 /* Profile - My Skills */
150
-                Route::get('profile/skills', 'SkillDeclarationController@editAuthenticated');
150
+                Route::get ('profile/skills', 'SkillDeclarationController@editAuthenticated');
151 151
 
152
-                Route::get('profile/{applicant}/skills', 'SkillDeclarationController@edit')
153
-                    ->middleware('can:view,applicant')
154
-                    ->middleware('can:update,applicant')
155
-                    ->name('profile.skills.edit');
152
+                Route::get ('profile/{applicant}/skills', 'SkillDeclarationController@edit')
153
+                    ->middleware ('can:view,applicant')
154
+                    ->middleware ('can:update,applicant')
155
+                    ->name ('profile.skills.edit');
156 156
 
157 157
                 /* Profile - My References */
158
-                Route::get('profile/references', 'ReferencesController@editAuthenticated');
158
+                Route::get ('profile/references', 'ReferencesController@editAuthenticated');
159 159
 
160
-                Route::get('profile/{applicant}/references', 'ReferencesController@edit')
161
-                    ->middleware('can:view,applicant')
162
-                    ->middleware('can:update,applicant')
163
-                    ->name('profile.references.edit');
160
+                Route::get ('profile/{applicant}/references', 'ReferencesController@edit')
161
+                    ->middleware ('can:view,applicant')
162
+                    ->middleware ('can:update,applicant')
163
+                    ->name ('profile.references.edit');
164 164
 
165 165
                 /* Profile - My Portfolio */
166
-                Route::get('profile/portfolio', 'WorkSamplesController@editAuthenticated');
166
+                Route::get ('profile/portfolio', 'WorkSamplesController@editAuthenticated');
167 167
 
168
-                Route::get('profile/{applicant}/portfolio', 'WorkSamplesController@edit')
169
-                    ->middleware('can:view,applicant')
170
-                    ->middleware('can:update,applicant')
171
-                    ->name('profile.work_samples.edit');
168
+                Route::get ('profile/{applicant}/portfolio', 'WorkSamplesController@edit')
169
+                    ->middleware ('can:view,applicant')
170
+                    ->middleware ('can:update,applicant')
171
+                    ->name ('profile.work_samples.edit');
172 172
             });
173 173
 
174 174
             /* Static - FAQ */
175
-            Route::get('faq', 'FaqController')->name('faq');
175
+            Route::get ('faq', 'FaqController')->name ('faq');
176 176
 
177 177
             /* Static - Privacy Policy */
178
-            Route::view('privacy', 'common/static_privacy', ['privacy' => Lang::get('common/privacy')])
179
-                ->name('privacy');
178
+            Route::view ('privacy', 'common/static_privacy', ['privacy' => Lang::get ('common/privacy')])
179
+                ->name ('privacy');
180 180
 
181 181
             /* Static - Terms of Service */
182
-            Route::view('tos', 'common/static_tos', ['tos' => Lang::get('common/tos')])->name('tos');
182
+            Route::view ('tos', 'common/static_tos', ['tos' => Lang::get ('common/tos')])->name ('tos');
183 183
 
184 184
             /* Static - ITP */
185
-            Route::view('indigenous', 'common/static-itp', ['itp' => Lang::get('common/itp')])->name('itp');
185
+            Route::view ('indigenous', 'common/static-itp', ['itp' => Lang::get ('common/itp')])->name ('itp');
186 186
 
187 187
             /* Authentication =========================================================== */
188 188
 
189 189
             // Laravel default login, logout, register, and reset routes
190
-            Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
191
-            Route::post('login', 'Auth\LoginController@login')->name('login.post');
192
-            Route::post('logout', 'Auth\LoginController@logout')->name('logout');
190
+            Route::get ('login', 'Auth\LoginController@showLoginForm')->name ('login');
191
+            Route::post ('login', 'Auth\LoginController@login')->name ('login.post');
192
+            Route::post ('logout', 'Auth\LoginController@logout')->name ('logout');
193 193
 
194 194
             // Registration Routes...
195
-            Route::get('register', 'Auth\RegisterController@showRegistrationForm')->name('register');
196
-            Route::post('register', 'Auth\RegisterController@register')->name('register.post');
195
+            Route::get ('register', 'Auth\RegisterController@showRegistrationForm')->name ('register');
196
+            Route::post ('register', 'Auth\RegisterController@register')->name ('register.post');
197 197
 
198 198
             // Password Reset Routes...
199
-            Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request');
200
-            Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email');
201
-            Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset');
202
-            Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.reset.post');
199
+            Route::get ('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name ('password.request');
200
+            Route::post ('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name ('password.email');
201
+            Route::get ('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name ('password.reset');
202
+            Route::post ('password/reset', 'Auth\ResetPasswordController@reset')->name ('password.reset.post');
203 203
         });
204 204
 
205 205
 
206 206
         /* Manager Portal =========================================================== */
207 207
 
208
-        Route::group([
209
-            'prefix' => config('app.manager_prefix'),
208
+        Route::group ([
209
+            'prefix' => config ('app.manager_prefix'),
210 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
-                Route::get('/', 'HomepageController@manager')->name('manager.home');
215
+                Route::get ('/', 'HomepageController@manager')->name ('manager.home');
216 216
 
217 217
                 /* Static - FAQ */
218
-                Route::get(
218
+                Route::get (
219 219
                     'faq',
220 220
                     'ManagerProfileController@faq'
221
-                )->name('manager.faq');
221
+                )->name ('manager.faq');
222 222
 
223
-                Route::get(
223
+                Route::get (
224 224
                     'faq#manager-who',
225 225
                     'ManagerProfileController@faq'
226
-                )->name('manager.faq.section');
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
-                    Route::get('profile', 'ManagerProfileController@editAuthenticated')->name('manager.profile');
230
+                    Route::get ('profile', 'ManagerProfileController@editAuthenticated')->name ('manager.profile');
231 231
 
232 232
                     /* Profile */
233
-                    Route::get('profile/{manager}/edit', 'ManagerProfileController@edit')
234
-                    ->middleware('can:view,manager')
235
-                    ->middleware('can:update,manager')
236
-                    ->name('manager.profile.edit');
233
+                    Route::get ('profile/{manager}/edit', 'ManagerProfileController@edit')
234
+                    ->middleware ('can:view,manager')
235
+                    ->middleware ('can:update,manager')
236
+                    ->name ('manager.profile.edit');
237 237
 
238
-                    Route::post('profile/{manager}/update', 'ManagerProfileController@update')
239
-                    ->middleware('can:update,manager')
240
-                    ->name('manager.profile.update');
238
+                    Route::post ('profile/{manager}/update', 'ManagerProfileController@update')
239
+                    ->middleware ('can:update,manager')
240
+                    ->name ('manager.profile.update');
241 241
 
242 242
                     /* View Application */
243
-                    Route::get('applications/{application}', 'ApplicationController@show')
244
-                    ->middleware('can:view,application')
245
-                    ->name('manager.applications.show');
243
+                    Route::get ('applications/{application}', 'ApplicationController@show')
244
+                    ->middleware ('can:view,application')
245
+                    ->name ('manager.applications.show');
246 246
 
247 247
                     /* View Applicant Profile */
248
-                    Route::get('applicants/{applicant}', 'ApplicantProfileController@show')
249
-                    ->middleware('can:view,applicant')
250
-                    ->name('manager.applicants.show');
248
+                    Route::get ('applicants/{applicant}', 'ApplicantProfileController@show')
249
+                    ->middleware ('can:view,applicant')
250
+                    ->name ('manager.applicants.show');
251 251
 
252 252
                     /* Job Index */
253
-                    Route::get('jobs', 'JobController@managerIndex')->name('manager.jobs.index');
253
+                    Route::get ('jobs', 'JobController@managerIndex')->name ('manager.jobs.index');
254 254
 
255 255
                     /* View Job Poster */
256
-                    Route::get('jobs/{jobPoster}', 'JobController@show')
257
-                    ->where('jobPoster', '[0-9]+')
258
-                    ->middleware('can:view,jobPoster')
259
-                    ->name('manager.jobs.show');
256
+                    Route::get ('jobs/{jobPoster}', 'JobController@show')
257
+                    ->where ('jobPoster', '[0-9]+')
258
+                    ->middleware ('can:view,jobPoster')
259
+                    ->name ('manager.jobs.show');
260 260
 
261
-                    Route::get('jobs/{jobPoster}/applications', 'ApplicationByJobController@index')
262
-                    ->where('jobPoster', '[0-9]+')
263
-                    ->middleware('can:reviewApplicationsFor,jobPoster')
264
-                    ->name('manager.jobs.applications');
261
+                    Route::get ('jobs/{jobPoster}/applications', 'ApplicationByJobController@index')
262
+                    ->where ('jobPoster', '[0-9]+')
263
+                    ->middleware ('can:reviewApplicationsFor,jobPoster')
264
+                    ->name ('manager.jobs.applications');
265 265
 
266 266
                     /* Job Builder */
267
-                    Route::get(
267
+                    Route::get (
268 268
                         'jobs/builder',
269 269
                         'JobBuilderController@show'
270
-                    )->name('manager.jobs.create');
270
+                    )->name ('manager.jobs.create');
271 271
 
272
-                    Route::get(
272
+                    Route::get (
273 273
                         'jobs/{jobId}/builder',
274 274
                         'JobBuilderController@show'
275 275
                     )
276
-                        ->where('jobPoster', '[0-9]+')
277
-                        ->name('manager.jobs.edit');
278
-                    Route::get(
276
+                        ->where ('jobPoster', '[0-9]+')
277
+                        ->name ('manager.jobs.edit');
278
+                    Route::get (
279 279
                         'jobs/{jobId}/builder/intro',
280 280
                         'JobBuilderController@show'
281
-                    )->where('jobPoster', '[0-9]+');
282
-                    Route::get(
281
+                    )->where ('jobPoster', '[0-9]+');
282
+                    Route::get (
283 283
                         'jobs/{jobId}/builder/details',
284 284
                         'JobBuilderController@show'
285
-                    )->where('jobPoster', '[0-9]+');
286
-                    Route::get(
285
+                    )->where ('jobPoster', '[0-9]+');
286
+                    Route::get (
287 287
                         'jobs/{jobId}/builder/environment',
288 288
                         'JobBuilderController@show'
289
-                    )->where('jobPoster', '[0-9]+');
290
-                    Route::get(
289
+                    )->where ('jobPoster', '[0-9]+');
290
+                    Route::get (
291 291
                         'jobs/{jobId}/builder/impact',
292 292
                         'JobBuilderController@show'
293
-                    )->where('jobPoster', '[0-9]+');
294
-                    Route::get(
293
+                    )->where ('jobPoster', '[0-9]+');
294
+                    Route::get (
295 295
                         'jobs/{jobId}/builder/tasks',
296 296
                         'JobBuilderController@show'
297
-                    )->where('jobPoster', '[0-9]+');
298
-                    Route::get(
297
+                    )->where ('jobPoster', '[0-9]+');
298
+                    Route::get (
299 299
                         'jobs/{jobId}/builder/skills',
300 300
                         'JobBuilderController@show'
301
-                    )->where('jobPoster', '[0-9]+');
302
-                    Route::get(
301
+                    )->where ('jobPoster', '[0-9]+');
302
+                    Route::get (
303 303
                         'jobs/{jobId}/builder/review',
304 304
                         'JobBuilderController@show'
305 305
                     )
306
-                        ->where('jobPoster', '[0-9]+')
307
-                        ->name('manager.jobs.review');
306
+                        ->where ('jobPoster', '[0-9]+')
307
+                        ->name ('manager.jobs.review');
308 308
 
309 309
                     /* Delete Job */
310
-                    Route::delete('jobs/{jobPoster}', 'JobController@destroy')
311
-                        ->where('jobPoster', '[0-9]+')
312
-                        ->middleware('can:delete,jobPoster')
313
-                        ->name('manager.jobs.destroy');
310
+                    Route::delete ('jobs/{jobPoster}', 'JobController@destroy')
311
+                        ->where ('jobPoster', '[0-9]+')
312
+                        ->middleware ('can:delete,jobPoster')
313
+                        ->name ('manager.jobs.destroy');
314 314
 
315
-                    Route::view(
315
+                    Route::view (
316 316
                         'jobs/{jobPoster}/assessment-plan',
317 317
                         'manager/assessment_plan'
318 318
                     )
319
-                        ->where('jobPoster', '[0-9]+')
320
-                        ->name('manager.jobs.screening_plan');
319
+                        ->where ('jobPoster', '[0-9]+')
320
+                        ->name ('manager.jobs.screening_plan');
321 321
                 });
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 {
326
-                Route::get('first-visit', 'Auth\FirstVisitController@showFirstVisitManagerForm')
327
-                    ->name('manager.first_visit');
328
-                Route::post('finish_registration', 'Auth\FirstVisitController@finishManagerRegistration')
329
-                    ->name('manager.finish_registration');
325
+            Route::middleware (['auth', 'role:manager'])->group (function (): void {
326
+                Route::get ('first-visit', 'Auth\FirstVisitController@showFirstVisitManagerForm')
327
+                    ->name ('manager.first_visit');
328
+                Route::post ('finish_registration', 'Auth\FirstVisitController@finishManagerRegistration')
329
+                    ->name ('manager.finish_registration');
330 330
             });
331 331
 
332 332
             // Laravel default login, logout, register, and reset routes
333
-            Route::get('login', 'Auth\LoginController@showLoginForm')->name('manager.login');
334
-            Route::post('login', 'Auth\LoginController@login')->name('manager.login.post');
335
-            Route::post('logout', 'Auth\LoginController@logout')->name('manager.logout');
333
+            Route::get ('login', 'Auth\LoginController@showLoginForm')->name ('manager.login');
334
+            Route::post ('login', 'Auth\LoginController@login')->name ('manager.login.post');
335
+            Route::post ('logout', 'Auth\LoginController@logout')->name ('manager.logout');
336 336
 
337 337
             // Registration Routes...
338
-            Route::get('register', 'Auth\RegisterController@showManagerRegistrationForm')->name('manager.register');
339
-            Route::post('register', 'Auth\RegisterController@registerManager')->name('manager.register.post');
338
+            Route::get ('register', 'Auth\RegisterController@showManagerRegistrationForm')->name ('manager.register');
339
+            Route::post ('register', 'Auth\RegisterController@registerManager')->name ('manager.register.post');
340 340
 
341 341
             // Password Reset Routes...
342
-            Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('manager.password.request');
343
-            Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('manager.password.email');
344
-            Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('manager.password.reset');
345
-            Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('manager.password.reset.post');
342
+            Route::get ('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name ('manager.password.request');
343
+            Route::post ('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name ('manager.password.email');
344
+            Route::get ('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name ('manager.password.reset');
345
+            Route::post ('password/reset', 'Auth\ResetPasswordController@reset')->name ('manager.password.reset.post');
346 346
         });
347 347
 
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
-            Route::delete('courses/{course}', 'CourseController@destroy')
354
-                ->middleware('can:delete,course')
355
-                ->name('courses.destroy');
353
+            Route::delete ('courses/{course}', 'CourseController@destroy')
354
+                ->middleware ('can:delete,course')
355
+                ->name ('courses.destroy');
356 356
 
357
-            Route::delete('degrees/{degree}', 'DegreeController@destroy')
358
-                ->middleware('can:delete,degree')
359
-                ->name('degrees.destroy');
357
+            Route::delete ('degrees/{degree}', 'DegreeController@destroy')
358
+                ->middleware ('can:delete,degree')
359
+                ->name ('degrees.destroy');
360 360
 
361
-            Route::delete('work-experiences/{workExperience}', 'WorkExperienceController@destroy')
362
-                ->middleware('can:delete,workExperience')
363
-                ->name('work_experiences.destroy');
361
+            Route::delete ('work-experiences/{workExperience}', 'WorkExperienceController@destroy')
362
+                ->middleware ('can:delete,workExperience')
363
+                ->name ('work_experiences.destroy');
364 364
 
365
-            Route::post('skill-declarations', 'SkillDeclarationController@create')
366
-                ->middleware('can:create,App\Models\SkillDeclaration')
367
-                ->name('skill_declarations.create');
365
+            Route::post ('skill-declarations', 'SkillDeclarationController@create')
366
+                ->middleware ('can:create,App\Models\SkillDeclaration')
367
+                ->name ('skill_declarations.create');
368 368
 
369
-            Route::put('skill-declarations/{skillDeclaration}', 'SkillDeclarationController@update')
370
-                ->middleware('can:update,skillDeclaration')
371
-                ->name('skill_declarations.update');
369
+            Route::put ('skill-declarations/{skillDeclaration}', 'SkillDeclarationController@update')
370
+                ->middleware ('can:update,skillDeclaration')
371
+                ->name ('skill_declarations.update');
372 372
 
373
-            Route::delete('skill-declarations/{skillDeclaration}', 'SkillDeclarationController@destroy')
374
-                ->middleware('can:delete,skillDeclaration')
375
-                ->name('skill_declarations.destroy');
373
+            Route::delete ('skill-declarations/{skillDeclaration}', 'SkillDeclarationController@destroy')
374
+                ->middleware ('can:delete,skillDeclaration')
375
+                ->name ('skill_declarations.destroy');
376 376
 
377
-            Route::post('references', 'ReferencesController@update')
378
-                ->middleware('can:create,App\Models\Reference')
379
-                ->name('references.create');
377
+            Route::post ('references', 'ReferencesController@update')
378
+                ->middleware ('can:create,App\Models\Reference')
379
+                ->name ('references.create');
380 380
 
381
-            Route::put('references/{reference}', 'ReferencesController@update')
382
-                ->middleware('can:update,reference')
383
-                ->name('references.update');
381
+            Route::put ('references/{reference}', 'ReferencesController@update')
382
+                ->middleware ('can:update,reference')
383
+                ->name ('references.update');
384 384
 
385
-            Route::delete('references/{reference}', 'ReferencesController@destroy')
386
-                ->middleware('can:delete,reference')
387
-                ->name('references.destroy');
385
+            Route::delete ('references/{reference}', 'ReferencesController@destroy')
386
+                ->middleware ('can:delete,reference')
387
+                ->name ('references.destroy');
388 388
 
389
-            Route::post('work-samples', 'WorkSamplesController@update')
390
-                ->middleware('can:create,App\Models\WorkSample')
391
-                ->name('work_samples.create');
389
+            Route::post ('work-samples', 'WorkSamplesController@update')
390
+                ->middleware ('can:create,App\Models\WorkSample')
391
+                ->name ('work_samples.create');
392 392
 
393
-            Route::put('work-samples/{workSample}', 'WorkSamplesController@update')
394
-                ->middleware('can:update,workSample')
395
-                ->name('work_samples.update');
393
+            Route::put ('work-samples/{workSample}', 'WorkSamplesController@update')
394
+                ->middleware ('can:update,workSample')
395
+                ->name ('work_samples.update');
396 396
 
397
-            Route::delete('work-samples/{workSample}', 'WorkSamplesController@destroy')
398
-                ->middleware('can:delete,workSample')
399
-                ->name('work_samples.destroy');
397
+            Route::delete ('work-samples/{workSample}', 'WorkSamplesController@destroy')
398
+                ->middleware ('can:delete,workSample')
399
+                ->name ('work_samples.destroy');
400 400
 
401
-            Route::delete('applications/{application}', 'ApplicationController@destroy')
402
-                ->middleware('can:delete,application')
403
-                ->name('applications.destroy');
401
+            Route::delete ('applications/{application}', 'ApplicationController@destroy')
402
+                ->middleware ('can:delete,application')
403
+                ->name ('applications.destroy');
404 404
 
405
-            Route::put('applications/{application}/review', 'ApplicationReviewController@updateForApplication')
406
-                ->middleware('can:review,application')
407
-                ->name('application_reviews.update');
405
+            Route::put ('applications/{application}/review', 'ApplicationReviewController@updateForApplication')
406
+                ->middleware ('can:review,application')
407
+                ->name ('application_reviews.update');
408 408
         });
409 409
 
410 410
 
411 411
         /* Non-Backpack Admin Portal (localized pages) =========================================================== */
412
-        Route::group(
412
+        Route::group (
413 413
             [
414 414
                 'prefix' => 'admin',
415 415
                 'middleware' => ['auth', 'role:admin']
416 416
             ],
417 417
             function (): void {
418 418
                 /* Edit Job */
419
-                Route::get('jobs/{jobPoster}/edit', 'JobController@edit')
420
-                    ->where('jobPoster', '[0-9]+')
421
-                    ->middleware('can:update,jobPoster')
422
-                    ->name('admin.jobs.edit');
423
-                Route::post('jobs/{jobPoster}', 'JobController@store')
424
-                    ->where('jobPoster', '[0-9]+')
425
-                    ->middleware('can:update,jobPoster')
426
-                    ->name('admin.jobs.update');
419
+                Route::get ('jobs/{jobPoster}/edit', 'JobController@edit')
420
+                    ->where ('jobPoster', '[0-9]+')
421
+                    ->middleware ('can:update,jobPoster')
422
+                    ->name ('admin.jobs.edit');
423
+                Route::post ('jobs/{jobPoster}', 'JobController@store')
424
+                    ->where ('jobPoster', '[0-9]+')
425
+                    ->middleware ('can:update,jobPoster')
426
+                    ->name ('admin.jobs.update');
427 427
             }
428 428
         );
429 429
     }
430 430
 );
431 431
 
432 432
 /* Non-Backpack Admin Portal (non-localized pages) =========================================================== */
433
-Route::group(
433
+Route::group (
434 434
     [
435 435
         'prefix' => 'admin',
436 436
         'middleware' => ['auth', 'role:admin']
437 437
     ],
438 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
-        Route::post('jobs/create/as-manager/{manager}', 'JobController@createAsManager')
441
-            ->middleware('can:create,App\Models\JobPoster')
442
-            ->name('admin.jobs.create_as_manager');
440
+        Route::post ('jobs/create/as-manager/{manager}', 'JobController@createAsManager')
441
+            ->middleware ('can:create,App\Models\JobPoster')
442
+            ->name ('admin.jobs.create_as_manager');
443 443
     }
444 444
 );
445 445
 
@@ -449,65 +449,65 @@  discard block
 block discarded – undo
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
-    Route::get('jobs/{jobPoster}/assessment-plan', 'AssessmentPlanController@getForJob');
454
+    Route::get ('jobs/{jobPoster}/assessment-plan', 'AssessmentPlanController@getForJob');
455 455
     // Public, not protected by policy or gate
456
-    Route::get('skills', 'Api\SkillController@index');
457
-    Route::get('departments', 'Api\DepartmentController@index');
456
+    Route::get ('skills', 'Api\SkillController@index');
457
+    Route::get ('departments', 'Api\DepartmentController@index');
458 458
 
459 459
     // Resource Routes are protected by policies in controllers instead of middleware.
460
-    Route::resource('assessments', 'AssessmentController')->except([
460
+    Route::resource ('assessments', 'AssessmentController')->except ([
461 461
         'create', 'edit', 'index'
462 462
     ]);
463
-    Route::apiResource('rating-guide-answers', 'RatingGuideAnswerController')->except([
463
+    Route::apiResource ('rating-guide-answers', 'RatingGuideAnswerController')->except ([
464 464
         'index'
465
-    ])->parameters([
465
+    ])->parameters ([
466 466
         'rating-guide-answers' => 'ratingGuideAnswer'
467 467
     ]);
468
-    Route::resource('rating-guide-questions', 'RatingGuideQuestionController')->except([
468
+    Route::resource ('rating-guide-questions', 'RatingGuideQuestionController')->except ([
469 469
         'create', 'edit', 'index'
470 470
     ]);
471
-    Route::resource('assessment-plan-notifications', 'AssessmentPlanNotificationController')->except([
471
+    Route::resource ('assessment-plan-notifications', 'AssessmentPlanNotificationController')->except ([
472 472
         'store', 'create', 'edit'
473 473
     ]);
474 474
     // TODO: add policy middleware
475
-    Route::get('jobs/{jobPoster}/tasks', 'Api\JobTaskController@indexByJob')
476
-        ->where('jobPoster', '[0-9]+')
477
-        ->middleware('can:view,jobPoster');
478
-    Route::put('jobs/{jobPoster}/tasks', 'Api\JobTaskController@batchUpdate')
479
-        ->where('jobPoster', '[0-9]+')
480
-        ->middleware('can:update,jobPoster');
481
-
482
-
483
-     Route::get('jobs/{jobPoster}/criteria', 'Api\CriteriaController@indexByJob')
484
-        ->where('jobPoster', '[0-9]+')
485
-        ->middleware('can:view,jobPoster');
486
-    Route::put('jobs/{jobPoster}/criteria', 'Api\CriteriaController@batchUpdate')
487
-        ->where('jobPoster', '[0-9]+')
488
-        ->middleware('can:update,jobPoster');
489
-
490
-
491
-    Route::post('jobs/{job}/submit', 'Api\JobApiController@submitForReview')
492
-        ->where('job', '[0-9]+')
493
-        ->middleware('can:submitForReview,job')
494
-        ->name('api.jobs.submit');
495
-    Route::resource('jobs', 'Api\JobApiController')->only([
475
+    Route::get ('jobs/{jobPoster}/tasks', 'Api\JobTaskController@indexByJob')
476
+        ->where ('jobPoster', '[0-9]+')
477
+        ->middleware ('can:view,jobPoster');
478
+    Route::put ('jobs/{jobPoster}/tasks', 'Api\JobTaskController@batchUpdate')
479
+        ->where ('jobPoster', '[0-9]+')
480
+        ->middleware ('can:update,jobPoster');
481
+
482
+
483
+     Route::get ('jobs/{jobPoster}/criteria', 'Api\CriteriaController@indexByJob')
484
+        ->where ('jobPoster', '[0-9]+')
485
+        ->middleware ('can:view,jobPoster');
486
+    Route::put ('jobs/{jobPoster}/criteria', 'Api\CriteriaController@batchUpdate')
487
+        ->where ('jobPoster', '[0-9]+')
488
+        ->middleware ('can:update,jobPoster');
489
+
490
+
491
+    Route::post ('jobs/{job}/submit', 'Api\JobApiController@submitForReview')
492
+        ->where ('job', '[0-9]+')
493
+        ->middleware ('can:submitForReview,job')
494
+        ->name ('api.jobs.submit');
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'
501 501
     ]);
502 502
 
503
-    Route::resource('managers', 'Api\ManagerApiController')->only([
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
     ]);
509 509
 
510 510
     // User must be logged in to user currentuser routes
511
-    Route::get('currentuser/manager', 'Api\ManagerApiController@showAuthenticated')
512
-        ->middleware('auth');
511
+    Route::get ('currentuser/manager', 'Api\ManagerApiController@showAuthenticated')
512
+        ->middleware ('auth');
513 513
 });
Please login to merge, or discard this patch.
app/Services/Validation/Rules/WorkSamplesValidator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,29 +10,29 @@
 block discarded – undo
10 10
     protected $applicant;
11 11
     protected $file_type_id;
12 12
     
13
-    public function __construct(Applicant $applicant)
13
+    public function __construct (Applicant $applicant)
14 14
     {
15 15
         $this->applicant = $applicant;
16
-        $this->file_type_id = FileType::all()->pluck('id');
16
+        $this->file_type_id = FileType::all ()->pluck ('id');
17 17
     
18 18
     }
19
-    public function validate(WorkSamplesValidatorValidator $workSamplesValidator)
19
+    public function validate (WorkSamplesValidatorValidator $workSamplesValidator)
20 20
     {
21
-        $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $workSamplesValidator->id);
21
+        $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $workSamplesValidator->id);
22 22
         //This array is reset every time because applicants table can change frequently
23
-        $applicant_ids = Applicant::all()->pluck('id');
23
+        $applicant_ids = Applicant::all ()->pluck ('id');
24 24
         //Validate basic data is filled in
25
-        Validator::make($workSamplesValidator->getAttributes(), [
25
+        Validator::make ($workSamplesValidator->getAttributes (), [
26 26
             'applicant_id' => [
27 27
             'required',
28
-               Rule::in($applicant_ids->toArray()),
28
+               Rule::in ($applicant_ids->toArray ()),
29 29
         ],  
30 30
             'file_type_id' => [
31 31
             'required',
32
-               Rule::in($this->file_type_id->toArray()),
32
+               Rule::in ($this->file_type_id->toArray ()),
33 33
         ]           
34 34
        
35
-        ])->validate();
35
+        ])->validate ();
36 36
     }
37 37
      
38 38
 }
39 39
\ No newline at end of file
Please login to merge, or discard this patch.
app/Services/Validation/Rules/ReferencesValidator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -10,28 +10,28 @@
 block discarded – undo
10 10
     protected $applicant;
11 11
     protected $relationship_id;
12 12
     
13
-    public function __construct(Applicant $applicant)
13
+    public function __construct (Applicant $applicant)
14 14
     {
15 15
         $this->applicant = $applicant;
16
-        $this->relationship_id = Relationship::all()->pluck('id');
16
+        $this->relationship_id = Relationship::all ()->pluck ('id');
17 17
     }
18
-    public function validate(ReferencesValidator $referencesValidator)
18
+    public function validate (ReferencesValidator $referencesValidator)
19 19
     {
20
-        $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $referencesValidator->id);
20
+        $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $referencesValidator->id);
21 21
         //This array is reset every time because applicants table can change frequently
22
-        $applicant_ids = Applicant::all()->pluck('id');
22
+        $applicant_ids = Applicant::all ()->pluck ('id');
23 23
         //Validate basic data is filled in
24
-        Validator::make($referencesValidator->getAttributes(), [
24
+        Validator::make ($referencesValidator->getAttributes (), [
25 25
             'applicant_id' => [
26 26
                 'required',
27
-                Rule::in($applicant_ids->toArray()),      
27
+                Rule::in ($applicant_ids->toArray ()),      
28 28
         ],  
29 29
             'relatonship_id' => [
30 30
             'required',
31
-            Rule::in($this->relationship_id->toArray()),
31
+            Rule::in ($this->relationship_id->toArray ()),
32 32
         ]       
33 33
             
34
-        ])->validate();
34
+        ])->validate ();
35 35
     }
36 36
      
37 37
 }
38 38
\ No newline at end of file
Please login to merge, or discard this patch.
app/Services/Validation/Rules/WorkExperienceValidator.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -13,24 +13,24 @@
 block discarded – undo
13 13
     
14 14
     protected $applicant;
15 15
  
16
-    public function __construct(Applicant $applicant)
16
+    public function __construct (Applicant $applicant)
17 17
     {
18 18
         $this->applicant = $applicant;
19 19
        
20 20
     }
21
-    public function validate(WorkExperienceValidator $workExperienceValidator)
21
+    public function validate (WorkExperienceValidator $workExperienceValidator)
22 22
     {
23
-        $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $workExperienceValidator->id);
23
+        $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $workExperienceValidator->id);
24 24
         //This array is reset every time because applicants table can change frequently
25
-        $applicant_ids = Applicant::all()->pluck('id');
25
+        $applicant_ids = Applicant::all ()->pluck ('id');
26 26
         //Validate basic data is filled in
27
-        Validator::make($workExperienceValidator->getAttributes(), [  
27
+        Validator::make ($workExperienceValidator->getAttributes (), [  
28 28
             'applicant_id' => [
29 29
                 'required',
30
-                Rule::in($applicant_ids->toArray()),
30
+                Rule::in ($applicant_ids->toArray ()),
31 31
         ]
32 32
          
33
-        ])->validate();
33
+        ])->validate ();
34 34
     }
35 35
     
36 36
 }
37 37
\ No newline at end of file
Please login to merge, or discard this patch.
app/Services/Validation/Rules/DegreeValidator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,29 +12,29 @@
 block discarded – undo
12 12
     protected $applicant;
13 13
     protected $degree_type_id;
14 14
 
15
-    public function __construct(Applicant $applicant)
15
+    public function __construct (Applicant $applicant)
16 16
     {
17 17
         $this->applicant = $applicant;
18
-        $this->degree_type_id = DegreeType::all()->pluck('id');
18
+        $this->degree_type_id = DegreeType::all ()->pluck ('id');
19 19
 
20 20
     }
21
-    public function validate(DegreeValidator $degreeValidator)
21
+    public function validate (DegreeValidator $degreeValidator)
22 22
     {
23
-        $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $degreeValidator->id);
23
+        $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $degreeValidator->id);
24 24
         //This array is reset every time because applicants table can change frequently
25
-        $applicant_ids = Applicant::all()->pluck('id');
25
+        $applicant_ids = Applicant::all ()->pluck ('id');
26 26
         //Validate basic data is filled in
27
-        Validator::make($degreeValidator->getAttributes(), [
27
+        Validator::make ($degreeValidator->getAttributes (), [
28 28
             'applicant_id' => [
29 29
             'required',
30
-               Rule::in($applicant_ids->toArray()),
30
+               Rule::in ($applicant_ids->toArray ()),
31 31
         ],
32 32
             'degree_type_id' => [
33 33
             'required',
34
-               Rule::in($this->degree_type_id->toArray()),
34
+               Rule::in ($this->degree_type_id->toArray ()),
35 35
         ]
36 36
 
37
-        ])->validate();
37
+        ])->validate ();
38 38
     }
39 39
 
40 40
 }
Please login to merge, or discard this patch.
app/Services/Validation/Rules/CourseValidator.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -12,28 +12,28 @@
 block discarded – undo
12 12
     protected $applicant;
13 13
     protected $course_status_id;
14 14
     
15
-    public function __construct(Applicant $applicant)
15
+    public function __construct (Applicant $applicant)
16 16
     {
17 17
         $this->applicant = $applicant;
18
-        $this->course_status_ids = CourseStatus::all()->pluck('id');
18
+        $this->course_status_ids = CourseStatus::all ()->pluck ('id');
19 19
     }
20
-    public function validate(CourseValidator $courseValidator)
20
+    public function validate (CourseValidator $courseValidator)
21 21
     {
22
-        $uniqueSkillRule = new UniqueApplicantSkillRule($this->applicant, $courseValidator->id);
22
+        $uniqueSkillRule = new UniqueApplicantSkillRule ($this->applicant, $courseValidator->id);
23 23
         //This array is reset every time because applicants table can change frequently
24
-        $applicant_ids = Applicant::all()->pluck('id');
24
+        $applicant_ids = Applicant::all ()->pluck ('id');
25 25
         //Validate basic data is filled in
26
-        Validator::make($courseValidator->getAttributes(), [ 
26
+        Validator::make ($courseValidator->getAttributes (), [ 
27 27
             'applicant_id' => [
28 28
              'required',
29
-                Rule::in($applicant_ids->toArray()),
29
+                Rule::in ($applicant_ids->toArray ()),
30 30
        ],
31 31
              'course_status_id' => [
32 32
              'required',
33
-                Rule::in($this->course_status_ids->toArray()),    
33
+                Rule::in ($this->course_status_ids->toArray ()),    
34 34
      ]
35 35
          
36
-        ])->validate();
36
+        ])->validate ();
37 37
     }
38 38
     
39 39
 }
40 40
\ No newline at end of file
Please login to merge, or discard this patch.