Passed
Push — task/common-translation-packag... ( 1125af...852212 )
by Grant
08:02
created
app/Http/Controllers/WorkExperienceController.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,15 +16,15 @@
 block discarded – undo
16 16
      */
17 17
     public function destroy(Request $request, WorkExperience $workExperience)
18 18
     {
19
-        $this->authorize('delete', $workExperience);
20
-        $workExperience->delete();
19
+        $this->authorize ('delete', $workExperience);
20
+        $workExperience->delete ();
21 21
 
22
-        if ($request->ajax()) {
22
+        if ($request->ajax ()) {
23 23
             return [
24 24
                 'message' => 'Work Experience delete',
25 25
             ];
26 26
         }
27 27
 
28
-        return back();
28
+        return back ();
29 29
     }
30 30
 }
Please login to merge, or discard this patch.
app/Http/Controllers/ReferencesController.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
      */
22 22
     public function editAuthenticated(Request $request)
23 23
     {
24
-        $applicant = $request->user()->applicant;
25
-        return redirect(route('profile.references.edit', $applicant));
24
+        $applicant = $request->user ()->applicant;
25
+        return redirect (route ('profile.references.edit', $applicant));
26 26
     }
27 27
 
28 28
     /**
@@ -34,14 +34,14 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function edit(Request $request, Applicant $applicant)
36 36
     {
37
-        $applicant->load([
37
+        $applicant->load ([
38 38
             'references.projects',
39 39
             'skill_declarations.skill',
40 40
         ]);
41 41
 
42
-        return view('applicant/profile_04_references', [
42
+        return view ('applicant/profile_04_references', [
43 43
             'applicant' => $applicant,
44
-            'profile' => Lang::get('applicant/profile_references'),
44
+            'profile' => Lang::get ('applicant/profile_references'),
45 45
         ]);
46 46
     }
47 47
 
@@ -54,54 +54,54 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function update(Request $request, ?Reference $reference = null)
56 56
     {
57
-        $validator = new UpdateReferenceValidator();
58
-        $validator->validate($request->input());
57
+        $validator = new UpdateReferenceValidator ();
58
+        $validator->validate ($request->input ());
59 59
 
60 60
         if ($reference === null) {
61
-            $reference = new Reference();
62
-            $reference->applicant_id = $request->user()->applicant->id;
61
+            $reference = new Reference ();
62
+            $reference->applicant_id = $request->user ()->applicant->id;
63 63
         }
64
-        $reference->fill([
65
-            'name' => $request->input('name'),
66
-            'email' => $request->input('email'),
67
-            'relationship_id' => $request->input('relationship_id'),
68
-            'description' => $request->input('description'),
64
+        $reference->fill ([
65
+            'name' => $request->input ('name'),
66
+            'email' => $request->input ('email'),
67
+            'relationship_id' => $request->input ('relationship_id'),
68
+            'description' => $request->input ('description'),
69 69
         ]);
70
-        $reference->save();
70
+        $reference->save ();
71 71
 
72
-        $reference->load('projects');
72
+        $reference->load ('projects');
73 73
 
74 74
         // TODO: As soon as you can interact with projects outside of references,
75 75
         // this will become a dangerous operation.
76
-        $reference->projects()->delete();
76
+        $reference->projects ()->delete ();
77 77
 
78 78
         $newProjects = [];
79
-        if ($request->input('projects')) {
80
-            foreach ($request->input('projects') as $projectInput) {
81
-                $project = new Project();
79
+        if ($request->input ('projects')) {
80
+            foreach ($request->input ('projects') as $projectInput) {
81
+                $project = new Project ();
82 82
                 $project->applicant_id = $reference->applicant_id;
83
-                $project->fill([
83
+                $project->fill ([
84 84
                     'name' => $projectInput['name'],
85 85
                     'start_date' => $projectInput['start_date'],
86 86
                     'end_date' => $projectInput['end_date'],
87 87
                 ]);
88
-                $project->save();
88
+                $project->save ();
89 89
                 $newProjects[] = $project->id;
90 90
             }
91 91
         }
92
-        $reference->projects()->sync($newProjects);
92
+        $reference->projects ()->sync ($newProjects);
93 93
 
94 94
         // Attach relatives.
95
-        $skillIds = $this->getRelativeIds($request->input(), 'skills');
96
-        $reference->skill_declarations()->sync($skillIds);
95
+        $skillIds = $this->getRelativeIds ($request->input (), 'skills');
96
+        $reference->skill_declarations ()->sync ($skillIds);
97 97
 
98 98
         // If an ajax request, return the new object.
99
-        if ($request->ajax()) {
100
-            $reference->load('relationship');
101
-            $reference->load('projects');
102
-            return $reference->toJson();
99
+        if ($request->ajax ()) {
100
+            $reference->load ('relationship');
101
+            $reference->load ('projects');
102
+            return $reference->toJson ();
103 103
         } else {
104
-            return redirect()->back();
104
+            return redirect ()->back ();
105 105
         }
106 106
     }
107 107
 
@@ -114,19 +114,19 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function destroy(Request $request, Reference $reference)
116 116
     {
117
-        $this->authorize('delete', $reference);
117
+        $this->authorize ('delete', $reference);
118 118
 
119 119
         // TODO: when projects exist independently on profile, delete separately.
120
-        $reference->projects()->delete();
120
+        $reference->projects ()->delete ();
121 121
 
122
-        $reference->delete();
122
+        $reference->delete ();
123 123
 
124
-        if ($request->ajax()) {
124
+        if ($request->ajax ()) {
125 125
             return [
126 126
                 'message' => 'Reference deleted'
127 127
             ];
128 128
         }
129 129
 
130
-        return redirect()->back();
130
+        return redirect ()->back ();
131 131
     }
132 132
 }
Please login to merge, or discard this patch.
app/Http/Controllers/JobController.php 1 patch
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function index()
25 25
     {
26
-        $now = Carbon::now();
26
+        $now = Carbon::now ();
27 27
 
28 28
         // Find published jobs that are currently open for applications.
29 29
         // Eager load required relationships: Department, Province, JobTerm.
30 30
         // Eager load the count of submitted applications, to prevent the relationship
31 31
         // from being actually loaded and firing off events.
32
-        $jobs = JobPoster::where('open_date_time', '<=', $now)
33
-            ->where('close_date_time', '>=', $now)
34
-            ->where('published', true)
35
-            ->with([
32
+        $jobs = JobPoster::where ('open_date_time', '<=', $now)
33
+            ->where ('close_date_time', '>=', $now)
34
+            ->where ('published', true)
35
+            ->with ([
36 36
                 'department',
37 37
                 'province',
38 38
                 'job_term',
39 39
             ])
40
-            ->withCount([
40
+            ->withCount ([
41 41
                 'submitted_applications',
42 42
             ])
43
-            ->get();
44
-        return view('applicant/job_index', [
45
-            'job_index' => Lang::get('applicant/job_index'),
43
+            ->get ();
44
+        return view ('applicant/job_index', [
45
+            'job_index' => Lang::get ('applicant/job_index'),
46 46
             'jobs' => $jobs
47 47
         ]);
48 48
     }
@@ -54,31 +54,31 @@  discard block
 block discarded – undo
54 54
      */
55 55
     public function managerIndex()
56 56
     {
57
-        $manager = Auth::user()->manager;
57
+        $manager = Auth::user ()->manager;
58 58
 
59
-        $jobs = JobPoster::where('manager_id', $manager->id)
60
-            ->with('classification')
61
-            ->withCount('submitted_applications')
62
-            ->get();
59
+        $jobs = JobPoster::where ('manager_id', $manager->id)
60
+            ->with ('classification')
61
+            ->withCount ('submitted_applications')
62
+            ->get ();
63 63
 
64 64
         foreach ($jobs as &$job) {
65 65
             $chosen_lang = $job->chosen_lang;
66 66
 
67 67
             // Show chosen lang title if current title is empty.
68 68
             if (empty($job->title)) {
69
-                $job->title = $job->getTranslation('title', $chosen_lang);
69
+                $job->title = $job->getTranslation ('title', $chosen_lang);
70 70
                 $job->trans_required = true;
71 71
             }
72 72
 
73 73
             // Always preview and edit in the chosen language.
74
-            $job->preview_link = LaravelLocalization::getLocalizedURL($chosen_lang, route('manager.jobs.show', $job));
75
-            $job->edit_link = LaravelLocalization::getLocalizedURL($chosen_lang, route('manager.jobs.edit', $job));
74
+            $job->preview_link = LaravelLocalization::getLocalizedURL ($chosen_lang, route ('manager.jobs.show', $job));
75
+            $job->edit_link = LaravelLocalization::getLocalizedURL ($chosen_lang, route ('manager.jobs.edit', $job));
76 76
         }
77 77
 
78 78
 
79
-        return view('manager/job_index', [
79
+        return view ('manager/job_index', [
80 80
             // Localization Strings.
81
-            'jobs_l10n' => Lang::get('manager/job_index'),
81
+            'jobs_l10n' => Lang::get ('manager/job_index'),
82 82
             // Data.
83 83
             'jobs' => $jobs,
84 84
         ]);
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
      */
94 94
     public function destroy(Request $request, JobPoster $jobPoster)
95 95
     {
96
-        $jobPoster->delete();
96
+        $jobPoster->delete ();
97 97
     }
98 98
 
99 99
     /**
@@ -105,14 +105,14 @@  discard block
 block discarded – undo
105 105
      */
106 106
     public function show(Request $request, JobPoster $jobPoster)
107 107
     {
108
-        $jobPoster->load([
108
+        $jobPoster->load ([
109 109
             'department',
110 110
             'criteria.skill.skill_type',
111 111
             'manager.team_culture',
112 112
             'manager.work_environment'
113 113
         ]);
114 114
 
115
-        $user = Auth::user();
115
+        $user = Auth::user ();
116 116
 
117 117
         // TODO: Improve workplace photos, and reference them in template direction from WorkEnvironment model.
118 118
         $workplacePhotos = [];
@@ -125,36 +125,36 @@  discard block
 block discarded – undo
125 125
 
126 126
         // TODO: replace route('manager.show',manager.id) in templates with link using slug.
127 127
         $criteria = [
128
-            'essential' => $jobPoster->criteria->filter(
128
+            'essential' => $jobPoster->criteria->filter (
129 129
                 function ($value, $key) {
130 130
                     return $value->criteria_type->name == 'essential';
131 131
                 }
132 132
             ),
133
-            'asset' => $jobPoster->criteria->filter(
133
+            'asset' => $jobPoster->criteria->filter (
134 134
                 function ($value, $key) {
135 135
                     return $value->criteria_type->name == 'asset';
136 136
                 }
137 137
             ),
138 138
         ];
139 139
 
140
-        $jobLang = Lang::get('applicant/job_post');
140
+        $jobLang = Lang::get ('applicant/job_post');
141 141
 
142 142
         $applyButton = [];
143
-        if (!$jobPoster->published && $this->authorize('update', $jobPoster)) {
143
+        if (!$jobPoster->published && $this->authorize ('update', $jobPoster)) {
144 144
             $applyButton = [
145
-                'href' => route('manager.jobs.edit', $jobPoster->id),
145
+                'href' => route ('manager.jobs.edit', $jobPoster->id),
146 146
                 'title' => $jobLang['apply']['edit_link_title'],
147 147
                 'text' => $jobLang['apply']['edit_link_label'],
148 148
             ];
149
-        } elseif (Auth::check() && $jobPoster->isOpen()) {
149
+        } elseif (Auth::check () && $jobPoster->isOpen ()) {
150 150
             $applyButton = [
151
-                'href' => route('job.application.edit.1', $jobPoster->id),
151
+                'href' => route ('job.application.edit.1', $jobPoster->id),
152 152
                 'title' => $jobLang['apply']['apply_link_title'],
153 153
                 'text' => $jobLang['apply']['apply_link_label'],
154 154
             ];
155
-        } elseif (Auth::guest() && $jobPoster->isOpen()) {
155
+        } elseif (Auth::guest () && $jobPoster->isOpen ()) {
156 156
             $applyButton = [
157
-                'href' => route('job.application.edit.1', $jobPoster->id),
157
+                'href' => route ('job.application.edit.1', $jobPoster->id),
158 158
                 'title' => $jobLang['apply']['login_link_title'],
159 159
                 'text' => $jobLang['apply']['login_link_label'],
160 160
             ];
@@ -166,19 +166,19 @@  discard block
 block discarded – undo
166 166
             ];
167 167
         }
168 168
 
169
-        $jpb_release_date = strtotime('2019-08-21 16:18:17');
170
-        $job_created_at = strtotime($jobPoster->created_at);
169
+        $jpb_release_date = strtotime ('2019-08-21 16:18:17');
170
+        $job_created_at = strtotime ($jobPoster->created_at);
171 171
 
172 172
         // If the job poster is created after the release of the JPB.
173 173
         // Then, render with updated poster template.
174 174
         // Else, render with old poster template.
175 175
         if ($job_created_at > $jpb_release_date) {
176 176
             // Updated job poster (JPB).
177
-            return view(
177
+            return view (
178 178
                 'applicant/jpb_job_post',
179 179
                 [
180 180
                     'job_post' => $jobLang,
181
-                    'skill_template' => Lang::get('common/skills'),
181
+                    'skill_template' => Lang::get ('common/skills'),
182 182
                     'job' => $jobPoster,
183 183
                     'manager' => $jobPoster->manager,
184 184
                     'criteria' => $criteria,
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
             );
188 188
         } else {
189 189
             // Old job poster.
190
-            return view(
190
+            return view (
191 191
                 'applicant/job_post',
192 192
                 [
193 193
                     'job_post' => $jobLang,
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
                     'job' => $jobPoster,
200 200
                     'criteria' => $criteria,
201 201
                     'apply_button' => $applyButton,
202
-                    'skill_template' => Lang::get('common/skills'),
202
+                    'skill_template' => Lang::get ('common/skills'),
203 203
                 ]
204 204
             );
205 205
         }
@@ -217,20 +217,20 @@  discard block
 block discarded – undo
217 217
     {
218 218
         $manager = $jobPoster->manager;
219 219
 
220
-        if ($jobPoster->job_poster_questions === null || $jobPoster->job_poster_questions->count() === 0) {
221
-            $jobPoster->job_poster_questions()->saveMany($this->populateDefaultQuestions());
222
-            $jobPoster->refresh();
220
+        if ($jobPoster->job_poster_questions === null || $jobPoster->job_poster_questions->count () === 0) {
221
+            $jobPoster->job_poster_questions ()->saveMany ($this->populateDefaultQuestions ());
222
+            $jobPoster->refresh ();
223 223
         }
224 224
 
225
-        return view(
225
+        return view (
226 226
             'manager/job_create',
227 227
             [
228 228
                 // Localization Strings.
229
-                'job_l10n' => Lang::get('manager/job_edit'),
229
+                'job_l10n' => Lang::get ('manager/job_edit'),
230 230
                 // Data.
231 231
                 'manager' => $manager,
232 232
                 'job' => $jobPoster,
233
-                'form_action_url' => route('admin.jobs.update', $jobPoster),
233
+                'form_action_url' => route ('admin.jobs.update', $jobPoster),
234 234
             ]
235 235
         );
236 236
     }
@@ -243,21 +243,21 @@  discard block
 block discarded – undo
243 243
      */
244 244
     public function createAsManager(Manager $manager)
245 245
     {
246
-        $jobPoster = new JobPoster();
246
+        $jobPoster = new JobPoster ();
247 247
         $jobPoster->manager_id = $manager->id;
248 248
 
249 249
         // Save manager-specific info to the job poster - equivalent to the intro step of the JPB
250
-        $divisionEn = $manager->getTranslation('division', 'en');
251
-        $divisionFr = $manager->getTranslation('division', 'fr');
252
-        $jobPoster->fill([
250
+        $divisionEn = $manager->getTranslation ('division', 'en');
251
+        $divisionFr = $manager->getTranslation ('division', 'fr');
252
+        $jobPoster->fill ([
253 253
             'department_id' => $manager->department_id,
254 254
             'division' => ['en' => $divisionEn],
255 255
             'division' => ['fr' => $divisionFr],
256 256
         ]);
257 257
 
258
-        $jobPoster->save();
258
+        $jobPoster->save ();
259 259
 
260
-        return redirect()->route('manager.jobs.edit', $jobPoster->id);
260
+        return redirect ()->route ('manager.jobs.edit', $jobPoster->id);
261 261
     }
262 262
 
263 263
     /**
@@ -272,19 +272,19 @@  discard block
 block discarded – undo
272 272
     {
273 273
         // Don't allow edits for published Job Posters
274 274
         // Also check auth while we're at it.
275
-        $this->authorize('update', $jobPoster);
276
-        JobPosterValidator::validateUnpublished($jobPoster);
275
+        $this->authorize ('update', $jobPoster);
276
+        JobPosterValidator::validateUnpublished ($jobPoster);
277 277
 
278
-        $input = $request->input();
278
+        $input = $request->input ();
279 279
 
280 280
         if ($jobPoster->manager_id == null) {
281
-            $jobPoster->manager_id = $request->user()->manager->id;
282
-            $jobPoster->save();
281
+            $jobPoster->manager_id = $request->user ()->manager->id;
282
+            $jobPoster->save ();
283 283
         }
284 284
 
285
-        $this->fillAndSaveJobPosterQuestions($input, $jobPoster, true);
285
+        $this->fillAndSaveJobPosterQuestions ($input, $jobPoster, true);
286 286
 
287
-        return redirect(route('manager.jobs.show', $jobPoster->id));
287
+        return redirect (route ('manager.jobs.show', $jobPoster->id));
288 288
     }
289 289
 
290 290
     /**
@@ -298,17 +298,17 @@  discard block
 block discarded – undo
298 298
     protected function fillAndSaveJobPosterQuestions(array $input, JobPoster $jobPoster, bool $replace) : void
299 299
     {
300 300
         if ($replace) {
301
-            $jobPoster->job_poster_questions()->delete();
301
+            $jobPoster->job_poster_questions ()->delete ();
302 302
         }
303 303
 
304
-        if (!array_key_exists('question', $input) || !is_array($input['question'])) {
304
+        if (!array_key_exists ('question', $input) || !is_array ($input['question'])) {
305 305
             return;
306 306
         }
307 307
 
308 308
         foreach ($input['question'] as $question) {
309
-            $jobQuestion = new JobPosterQuestion();
309
+            $jobQuestion = new JobPosterQuestion ();
310 310
             $jobQuestion->job_poster_id = $jobPoster->id;
311
-            $jobQuestion->fill(
311
+            $jobQuestion->fill (
312 312
                 [
313 313
                     'question' => [
314 314
                         'en' => $question['question']['en'],
@@ -321,8 +321,8 @@  discard block
 block discarded – undo
321 321
                     ]
322 322
                 ]
323 323
             );
324
-            $jobPoster->save();
325
-            $jobQuestion->save();
324
+            $jobPoster->save ();
325
+            $jobQuestion->save ();
326 326
         }
327 327
     }
328 328
 
@@ -334,20 +334,20 @@  discard block
 block discarded – undo
334 334
     protected function populateDefaultQuestions()
335 335
     {
336 336
         $defaultQuestions = [
337
-            'en' => array_values(Lang::get('manager/job_create', [], 'en')['questions']),
338
-            'fr' => array_values(Lang::get('manager/job_create', [], 'fr')['questions']),
337
+            'en' => array_values (Lang::get ('manager/job_create', [], 'en')['questions']),
338
+            'fr' => array_values (Lang::get ('manager/job_create', [], 'fr')['questions']),
339 339
         ];
340 340
 
341
-        if (count($defaultQuestions['en']) !== count($defaultQuestions['fr'])) {
342
-            Log::warning('There must be the same number of French and English default questions for a Job Poster.');
341
+        if (count ($defaultQuestions['en']) !== count ($defaultQuestions['fr'])) {
342
+            Log::warning ('There must be the same number of French and English default questions for a Job Poster.');
343 343
             return;
344 344
         }
345 345
 
346 346
         $jobQuestions = [];
347 347
 
348
-        for ($i = 0; $i < count($defaultQuestions['en']); $i++) {
349
-            $jobQuestion = new JobPosterQuestion();
350
-            $jobQuestion->fill(
348
+        for ($i = 0; $i < count ($defaultQuestions['en']); $i++) {
349
+            $jobQuestion = new JobPosterQuestion ();
350
+            $jobQuestion->fill (
351 351
                 [
352 352
                     'question' => [
353 353
                         'en' => $defaultQuestions['en'][$i],
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ClassificationCrudController.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -21,14 +21,14 @@  discard block
 block discarded – undo
21 21
     public function setup() : void
22 22
     {
23 23
         // Eloquent model to associate with this collection of views and controller actions.
24
-        $this->crud->setModel('App\Models\Classification');
24
+        $this->crud->setModel ('App\Models\Classification');
25 25
         // Custom backpack route.
26
-        $this->crud->setRoute('admin/classification');
26
+        $this->crud->setRoute ('admin/classification');
27 27
         // Custom strings to display within the backpack UI.
28
-        $this->crud->setEntityNameStrings('classification', 'classifications');
28
+        $this->crud->setEntityNameStrings ('classification', 'classifications');
29 29
 
30
-        $this->crud->operation(['create', 'update'], function () {
31
-            $this->crud->addField([
30
+        $this->crud->operation (['create', 'update'], function () {
31
+            $this->crud->addField ([
32 32
                 'name' => 'key',
33 33
                 'type' => 'text',
34 34
                 'label' => 'Key',
@@ -38,13 +38,13 @@  discard block
 block discarded – undo
38 38
 
39 39
     public function setupListOperation()
40 40
     {
41
-        $this->crud->addColumn([
41
+        $this->crud->addColumn ([
42 42
             'name' => 'id',
43 43
             'type' => 'text',
44 44
             'label' => 'ID',
45 45
         ]);
46 46
 
47
-        $this->crud->addColumn([
47
+        $this->crud->addColumn ([
48 48
             'name' => 'key',
49 49
             'type' => 'text',
50 50
             'label' => 'Key',
@@ -53,11 +53,11 @@  discard block
 block discarded – undo
53 53
 
54 54
     public function setupCreateOperation()
55 55
     {
56
-        $this->crud->setValidation(StoreRequest::class);
56
+        $this->crud->setValidation (StoreRequest::class);
57 57
     }
58 58
 
59 59
     public function setupUpdateOperation()
60 60
     {
61
-        $this->crud->setValidation(UpdateRequest::class);
61
+        $this->crud->setValidation (UpdateRequest::class);
62 62
     }
63 63
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/SkillCrudController.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -26,37 +26,37 @@  discard block
 block discarded – undo
26 26
     {
27 27
         // Eloquent model to associate with this collection
28 28
         // of views and controller actions.
29
-        $this->crud->setModel('App\Models\Skill');
29
+        $this->crud->setModel ('App\Models\Skill');
30 30
         // Custom backpack route.
31
-        $this->crud->setRoute('admin/skill');
31
+        $this->crud->setRoute ('admin/skill');
32 32
         // Custom strings to display within the backpack UI,
33 33
         // things like Create Skill, Delete Skills, etc.
34
-        $this->crud->setEntityNameStrings('skill', 'skills');
34
+        $this->crud->setEntityNameStrings ('skill', 'skills');
35 35
 
36
-        $this->crud->operation(['create', 'update'], function () {
36
+        $this->crud->operation (['create', 'update'], function () {
37 37
             // Add custom fields to the create/update views.
38
-            $this->crud->addField([
38
+            $this->crud->addField ([
39 39
                 'name' => 'name',
40 40
                 'type' => 'text',
41 41
                 'label' => 'Name',
42 42
             ]);
43 43
 
44
-            $this->crud->addField([
44
+            $this->crud->addField ([
45 45
                 'name' => 'description',
46 46
                 'type' => 'textarea',
47 47
                 'label' => 'Description',
48 48
                 'limit' => 70,
49 49
             ]);
50 50
 
51
-            $this->crud->addField([
51
+            $this->crud->addField ([
52 52
                 'name' => 'skill_type_id',
53 53
                 'label' => 'Type',
54 54
                 'type' => 'select_from_array',
55
-                'options' => SkillType::all()->pluck('name', 'id')->toArray(),
55
+                'options' => SkillType::all ()->pluck ('name', 'id')->toArray (),
56 56
                 'allow_null' => false,
57 57
             ]);
58 58
 
59
-            $this->crud->addField([
59
+            $this->crud->addField ([
60 60
                 'name' => 'classifications',
61 61
                 'type' => 'select2_multiple',
62 62
                 'label' => 'Classifications (select all that apply)',
@@ -66,13 +66,13 @@  discard block
 block discarded – undo
66 66
                 'pivot' => true,
67 67
             ]);
68 68
 
69
-            $this->crud->addField([
69
+            $this->crud->addField ([
70 70
                 'name' => 'is_culture_skill',
71 71
                 'label' => 'This is a culture skill',
72 72
                 'type' => 'checkbox'
73 73
             ]);
74 74
 
75
-            $this->crud->addField([
75
+            $this->crud->addField ([
76 76
                 'name' => 'is_future_skill',
77 77
                 'label' => 'This is a future skill',
78 78
                 'type' => 'checkbox'
@@ -85,56 +85,56 @@  discard block
 block discarded – undo
85 85
         // Workaround for how the unique_translation validation
86 86
         // works in App\Http\Requests\SkillCrudRequest.
87 87
         $locale = 'en';
88
-        if (null !== $this->request->input('locale')) {
89
-            $locale = $this->request->input('locale');
88
+        if (null !== $this->request->input ('locale')) {
89
+            $locale = $this->request->input ('locale');
90 90
         }
91
-        App::setLocale($locale);
91
+        App::setLocale ($locale);
92 92
 
93 93
         // Remove delete button.
94
-        $this->crud->removeButton('delete');
94
+        $this->crud->removeButton ('delete');
95 95
 
96 96
         // Add custom columns to the Skill index view.
97
-        $this->crud->addColumn([
97
+        $this->crud->addColumn ([
98 98
             'name' => 'id',
99 99
             'type' => 'text',
100 100
             'label' => 'ID',
101 101
             'orderable' => true
102 102
         ]);
103 103
 
104
-        $this->crud->addColumn([
104
+        $this->crud->addColumn ([
105 105
             'name' => 'name',
106 106
             'type' => 'text',
107 107
             'label' => 'Name',
108 108
             'searchLogic' => function ($query, $column, $searchTerm) use ($locale) : void {
109
-                $query->orWhere('name->' . $locale, 'like', "%$searchTerm%");
109
+                $query->orWhere ('name->'.$locale, 'like', "%$searchTerm%");
110 110
             },
111 111
             'orderLogic' => function ($query, $column, $columnDirection) use ($locale) {
112
-                return $query->orderBy('name->' . $locale, $columnDirection)->select('*');
112
+                return $query->orderBy ('name->'.$locale, $columnDirection)->select ('*');
113 113
             }
114 114
         ]);
115 115
 
116
-        $this->crud->addColumn([
116
+        $this->crud->addColumn ([
117 117
             'name' => 'description',
118 118
             'type' => 'text',
119 119
             'label' => 'Description',
120 120
             'searchLogic' => function ($query, $column, $searchTerm) use ($locale) : void {
121
-                $query->orWhere('description->' . $locale, 'like', "%$searchTerm%");
121
+                $query->orWhere ('description->'.$locale, 'like', "%$searchTerm%");
122 122
             },
123 123
             'orderable' => false,
124 124
         ]);
125 125
 
126
-        $this->crud->addColumn([
126
+        $this->crud->addColumn ([
127 127
             'name' => 'skill_type.name',
128 128
             'key' => 'skill_type_name',
129 129
             'type' => 'text',
130 130
             'label' => 'Type',
131 131
             'orderable' => true,
132 132
             'orderLogic' => function ($query, $column, $columnDirection) use ($locale) {
133
-                return $query->orderBy('skill_type_id', $columnDirection)->select('*');
133
+                return $query->orderBy ('skill_type_id', $columnDirection)->select ('*');
134 134
             }
135 135
         ]);
136 136
 
137
-        $this->crud->addColumn([
137
+        $this->crud->addColumn ([
138 138
             'label' => 'Classifications',
139 139
             'type' => 'select_multiple',
140 140
             'name' => 'classifications',
@@ -143,14 +143,14 @@  discard block
 block discarded – undo
143 143
             'model' => 'App\Models\Skill',
144 144
         ]);
145 145
 
146
-        $this->crud->addColumn([
146
+        $this->crud->addColumn ([
147 147
             'name' => 'is_culture_skill',
148 148
             'label' => 'Culture',
149 149
             'type' => 'boolean',
150 150
             'orderable' => true,
151 151
         ]);
152 152
 
153
-        $this->crud->addColumn([
153
+        $this->crud->addColumn ([
154 154
             'name' => 'is_future_skill',
155 155
             'label' => 'Future',
156 156
             'type' => 'boolean',
@@ -158,25 +158,25 @@  discard block
 block discarded – undo
158 158
         ]);
159 159
 
160 160
         // Add select2_multiple filter for classifications.
161
-        $this->crud->addFilter([
161
+        $this->crud->addFilter ([
162 162
             'name' => 'classifications',
163 163
             'key' => 'classifications_filter',
164 164
             'type' => 'select2_multiple',
165 165
             'label' => 'Filter by classification'
166 166
         ], function () {
167 167
             // The options that show up in the select2.
168
-            return Classification::all()->pluck('key', 'id')->toArray();
168
+            return Classification::all ()->pluck ('key', 'id')->toArray ();
169 169
         }, function ($values) {
170 170
             // If the filter is active.
171
-            foreach (json_decode($values) as $key => $value) {
172
-                $this->crud->query = $this->crud->query->whereHas('classifications', function ($query) use ($value) {
173
-                    $query->where('id', $value);
171
+            foreach (json_decode ($values) as $key => $value) {
172
+                $this->crud->query = $this->crud->query->whereHas ('classifications', function ($query) use ($value) {
173
+                    $query->where ('id', $value);
174 174
                 });
175 175
             }
176 176
         });
177 177
 
178 178
         // Add filter for skills without classifications.
179
-        $this->crud->addFilter(
179
+        $this->crud->addFilter (
180 180
             [
181 181
                 'type' => 'simple',
182 182
                 'name' => 'noClassification',
@@ -184,18 +184,18 @@  discard block
 block discarded – undo
184 184
             ],
185 185
             false,
186 186
             function () {
187
-                $this->crud->query = $this->crud->query->doesntHave('classifications');
187
+                $this->crud->query = $this->crud->query->doesntHave ('classifications');
188 188
             }
189 189
         );
190 190
     }
191 191
 
192 192
     public function setupCreateOperation()
193 193
     {
194
-        $this->crud->setValidation(StoreRequest::class);
194
+        $this->crud->setValidation (StoreRequest::class);
195 195
     }
196 196
 
197 197
     public function setupUpdateOperation()
198 198
     {
199
-        $this->crud->setValidation(UpdateRequest::class);
199
+        $this->crud->setValidation (UpdateRequest::class);
200 200
     }
201 201
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/UserCrudController.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -18,68 +18,68 @@  discard block
 block discarded – undo
18 18
      */
19 19
     public function setup() : void
20 20
     {
21
-        $this->crud->setModel('App\Models\User');
22
-        $this->crud->setRoute('admin/user');
23
-        $this->crud->setEntityNameStrings('user', 'users');
21
+        $this->crud->setModel ('App\Models\User');
22
+        $this->crud->setRoute ('admin/user');
23
+        $this->crud->setEntityNameStrings ('user', 'users');
24 24
     }
25 25
 
26 26
     public function setupListOperation()
27 27
     {
28
-        $this->crud->addColumn([
28
+        $this->crud->addColumn ([
29 29
             'name' => 'id',
30 30
             'type' => 'number',
31 31
             'label' => 'ID'
32 32
         ]);
33
-        $this->crud->addColumn([
33
+        $this->crud->addColumn ([
34 34
             'name' => 'first_name',
35 35
             'type' => 'text',
36 36
             'label' => 'First Name'
37 37
         ]);
38
-        $this->crud->addColumn([
38
+        $this->crud->addColumn ([
39 39
             'name' => 'last_name',
40 40
             'type' => 'text',
41 41
             'label' => 'Last Name'
42 42
         ]);
43
-        $this->crud->addColumn([
43
+        $this->crud->addColumn ([
44 44
             'name' => 'user_role.name',
45 45
             'type' => 'text',
46 46
             'key' => 'user_role_name',
47 47
             'label' => 'Role'
48 48
         ]);
49
-        $this->crud->addColumn([
49
+        $this->crud->addColumn ([
50 50
             'name' => 'email',
51 51
             'type' => 'text',
52 52
             'label' => 'Email'
53 53
         ]);
54
-        $this->crud->addColumn([
54
+        $this->crud->addColumn ([
55 55
             'name' => 'gov_email',
56 56
             'type' => 'text',
57 57
             'label' => 'Government Email'
58 58
         ]);
59
-        $this->crud->addColumn([
59
+        $this->crud->addColumn ([
60 60
             'name' => 'not_in_gov',
61 61
             'type' => 'check',
62 62
             'label' => 'In Government'
63 63
         ]);
64
-        $this->crud->addColumn([
64
+        $this->crud->addColumn ([
65 65
             'name' => 'is_priority',
66 66
             'type' => 'check',
67 67
             'label' => 'Priority'
68 68
         ]);
69
-        $this->crud->addFilter([
69
+        $this->crud->addFilter ([
70 70
             'name' => 'user_role',
71 71
             'type' => 'select2',
72 72
             'label' => 'Role'
73 73
             ], function () {
74
-                return UserRole::all()->keyBy('id')->pluck('name', 'id')->toArray();
74
+                return UserRole::all ()->keyBy ('id')->pluck ('name', 'id')->toArray ();
75 75
             }, function ($value) : void {
76
-                $this->crud->addClause('where', 'user_role_id', $value);
76
+                $this->crud->addClause ('where', 'user_role_id', $value);
77 77
             });
78 78
     }
79 79
 
80 80
     public function setupUpdateOperation()
81 81
     {
82
-        $this->crud->addField([
82
+        $this->crud->addField ([
83 83
             'name' => 'name',
84 84
             'label' => 'Name',
85 85
             'type' => 'text',
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                 'readonly'=>'readonly'
88 88
             ]
89 89
         ]);
90
-        $this->crud->addField([
90
+        $this->crud->addField ([
91 91
             'label' => 'Role',
92 92
             'type' => 'select',
93 93
             'name' => 'user_role_id', // The db column for the foreign key.
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             'attribute' => 'name', // Foreign key attribute that is shown to user.
96 96
             'model' => 'App\Models\UserRole' // Foreign key model.
97 97
         ]);
98
-        $this->crud->addField([
98
+        $this->crud->addField ([
99 99
             'name' => 'is_priority',
100 100
             'type' => 'checkbox',
101 101
             'label' => 'Priority'
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/DepartmentCrudController.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -23,26 +23,26 @@  discard block
 block discarded – undo
23 23
     public function setup() : void
24 24
     {
25 25
         // Eloquent model to associate with this collection of views and controller actions.
26
-        $this->crud->setModel('App\Models\Lookup\Department');
26
+        $this->crud->setModel ('App\Models\Lookup\Department');
27 27
         // Custom backpack route.
28
-        $this->crud->setRoute('admin/department');
28
+        $this->crud->setRoute ('admin/department');
29 29
         // Custom strings to display within the backpack UI.
30
-        $this->crud->setEntityNameStrings('department', 'departments');
30
+        $this->crud->setEntityNameStrings ('department', 'departments');
31 31
 
32
-        $this->crud->operation(['create', 'update'], function () {
33
-            $this->crud->addField([
32
+        $this->crud->operation (['create', 'update'], function () {
33
+            $this->crud->addField ([
34 34
                 'name' => 'name',
35 35
                 'type' => 'text',
36 36
                 'label' => 'Name',
37 37
             ]);
38 38
 
39
-            $this->crud->addField([
39
+            $this->crud->addField ([
40 40
                 'name' => 'impact',
41 41
                 'type' => 'textarea',
42 42
                 'label' => 'Impact',
43 43
             ]);
44 44
 
45
-            $this->crud->addField([
45
+            $this->crud->addField ([
46 46
                 'name' => 'preference',
47 47
                 'type' => 'textarea',
48 48
                 'label' => 'Preference',
@@ -54,34 +54,34 @@  discard block
 block discarded – undo
54 54
     {
55 55
         // Required for order logic.
56 56
         $locale = 'en';
57
-        if (null !== $this->request->input('locale')) {
58
-            $locale = $this->request->input('locale');
57
+        if (null !== $this->request->input ('locale')) {
58
+            $locale = $this->request->input ('locale');
59 59
         }
60
-        App::setLocale($locale);
60
+        App::setLocale ($locale);
61 61
 
62 62
         // Remove delete button.
63
-        $this->crud->removeButton('delete');
63
+        $this->crud->removeButton ('delete');
64 64
 
65 65
         // Add custom columns to the Department index view.
66
-        $this->crud->addColumn([
66
+        $this->crud->addColumn ([
67 67
             'name' => 'id',
68 68
             'type' => 'text',
69 69
             'label' => 'ID',
70 70
             'orderable' => true,
71 71
         ]);
72 72
 
73
-        $this->crud->addColumn([
73
+        $this->crud->addColumn ([
74 74
             'name' => 'name',
75 75
             'type' => 'text',
76 76
             'label' => 'Name',
77 77
             'orderable' => true,
78 78
             'limit' => 70,
79 79
             'orderLogic' => function ($query, $column, $columnDirection) use ($locale) {
80
-                return $query->orderBy('name->' . $locale, $columnDirection)->select('*');
80
+                return $query->orderBy ('name->'.$locale, $columnDirection)->select ('*');
81 81
             }
82 82
         ]);
83 83
 
84
-        $this->crud->addColumn([
84
+        $this->crud->addColumn ([
85 85
             'name' => 'impact',
86 86
             'type' => 'text',
87 87
             'label' => 'Impact',
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             'limit' => 70,
90 90
         ]);
91 91
 
92
-        $this->crud->addColumn([
92
+        $this->crud->addColumn ([
93 93
             'name' => 'preference',
94 94
             'type' => 'text',
95 95
             'label' => 'Preference',
@@ -100,11 +100,11 @@  discard block
 block discarded – undo
100 100
 
101 101
     public function setupCreateOperation()
102 102
     {
103
-        $this->crud->setValidation(StoreRequest::class);
103
+        $this->crud->setValidation (StoreRequest::class);
104 104
     }
105 105
 
106 106
     public function setupUpdateOperation()
107 107
     {
108
-        $this->crud->setValidation(UpdateRequest::class);
108
+        $this->crud->setValidation (UpdateRequest::class);
109 109
     }
110 110
 }
Please login to merge, or discard this patch.
app/Http/Controllers/Admin/ManagerCrudController.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -17,49 +17,49 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function setup() : void
19 19
     {
20
-        $this->crud->setModel('App\Models\User');
21
-        $this->crud->setRoute('admin/manager');
22
-        $this->crud->setEntityNameStrings('manager', 'managers');
20
+        $this->crud->setModel ('App\Models\User');
21
+        $this->crud->setRoute ('admin/manager');
22
+        $this->crud->setEntityNameStrings ('manager', 'managers');
23 23
 
24 24
         // Don't show 'basic' users.
25
-        $this->crud->addClause('whereIn', 'user_role_id', [2, 3]);
25
+        $this->crud->addClause ('whereIn', 'user_role_id', [2, 3]);
26 26
     }
27 27
 
28 28
     public function setupListOperation()
29 29
     {
30
-        $this->crud->removeButton('update');
30
+        $this->crud->removeButton ('update');
31 31
 
32
-        $this->crud->addColumn([
32
+        $this->crud->addColumn ([
33 33
             'name' => 'manager.id',
34 34
             'key' => 'manager_id',
35 35
             'type' => 'number',
36 36
             'label' => 'ID'
37 37
         ]);
38
-        $this->crud->addColumn([
38
+        $this->crud->addColumn ([
39 39
             'name' => 'manager.full_name',
40 40
             'key' => 'manager_name',
41 41
             'type' => 'text',
42 42
             'label' => 'Name'
43 43
         ]);
44
-        $this->crud->addColumn([
44
+        $this->crud->addColumn ([
45 45
             'name' => 'user_role.name',
46 46
             'type' => 'text',
47 47
             'key' => 'user_role_name',
48 48
             'label' => 'Role'
49 49
         ]);
50
-        $this->crud->addColumn([
50
+        $this->crud->addColumn ([
51 51
             'name' => 'email',
52 52
             'key' => 'manager_email',
53 53
             'type' => 'text',
54 54
             'label' => 'Email'
55 55
         ]);
56
-        $this->crud->addColumn([
56
+        $this->crud->addColumn ([
57 57
             'name' => 'gov_email',
58 58
             'key' => 'government_email',
59 59
             'type' => 'text',
60 60
             'label' => 'Government Email'
61 61
         ]);
62
-        $this->crud->addColumn([
62
+        $this->crud->addColumn ([
63 63
             'name' => 'manager.department.name',
64 64
             'key' => 'manager_department',
65 65
             'type' => 'text',
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         ]);
69 69
 
70 70
         // Add the custom blade button found in resources/views/vendor/backpack/crud/buttons/profile_edit.blade.php.
71
-        $this->crud->addButtonFromView('line', 'create_job_poster', 'create_job_poster', 'beginning');
72
-        $this->crud->addButtonFromView('line', 'profile_edit', 'profile_edit', 'end');
71
+        $this->crud->addButtonFromView ('line', 'create_job_poster', 'create_job_poster', 'beginning');
72
+        $this->crud->addButtonFromView ('line', 'profile_edit', 'profile_edit', 'end');
73 73
     }
74 74
 }
Please login to merge, or discard this patch.
app/Http/Controllers/ApplicationController.php 1 patch
Spacing   +26 added lines, -27 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
      */
20 20
     public function index()
21 21
     {
22
-        $applications = Auth::user()->applicant->job_applications;
23
-        return view(
22
+        $applications = Auth::user ()->applicant->job_applications;
23
+        return view (
24 24
             'applicant/application_index',
25 25
             [
26
-                'application_index' => Lang::get('applicant/application_index'),
26
+                'application_index' => Lang::get ('applicant/application_index'),
27 27
                 'applications' => $applications,
28
-                'departments_template' => Lang::get('common/lookup/departments'),
28
+                'departments_template' => Lang::get ('common/lookup/departments'),
29 29
                 'manager_profile_photo' => '/images/user.png', // TODO: get real photo.
30 30
             ]
31 31
         );
@@ -40,48 +40,47 @@  discard block
 block discarded – undo
40 40
     public function show(JobApplication $application)
41 41
     {
42 42
         $criteria = [
43
-            'essential' => $application->job_poster->criteria->filter(function ($value, $key) {
43
+            'essential' => $application->job_poster->criteria->filter (function ($value, $key) {
44 44
                 return $value->criteria_type->name == 'essential';
45 45
             }),
46
-            'asset' => $application->job_poster->criteria->filter(function ($value, $key) {
46
+            'asset' => $application->job_poster->criteria->filter (function ($value, $key) {
47 47
                 return $value->criteria_type->name == 'asset';
48 48
             }),
49 49
         ];
50 50
 
51 51
         // Display slightly different views on different portals.
52
-        $view = WhichPortal::isManagerPortal() ?
53
-            'manager/application_post' :
54
-            'applicant/application_preview';
52
+        $view = WhichPortal::isManagerPortal () ?
53
+            'manager/application_post' : 'applicant/application_preview';
55 54
 
56
-        if (WhichPortal::isManagerPortal()) {
55
+        if (WhichPortal::isManagerPortal ()) {
57 56
             // Load things required for review component.
58
-            $application->load(['veteran_status', 'citizenship_declaration', 'application_review', 'applicant.user']);
57
+            $application->load (['veteran_status', 'citizenship_declaration', 'application_review', 'applicant.user']);
59 58
         }
60 59
 
61
-        return view(
60
+        return view (
62 61
             $view,
63 62
             [
64 63
                 // Localized strings.
65
-                'post' => Lang::get('manager/application_post'), // Change text
66
-                'is_manager_view' => WhichPortal::isManagerPortal(),
64
+                'post' => Lang::get ('manager/application_post'), // Change text
65
+                'is_manager_view' => WhichPortal::isManagerPortal (),
67 66
                 // Application Template Data.
68
-                'application_template' => Lang::get('applicant/application_template'),
67
+                'application_template' => Lang::get ('applicant/application_template'),
69 68
                 'application_preview' => true,
70
-                'preferred_language_template' => Lang::get('common/preferred_language'),
71
-                'citizenship_declaration_template' => Lang::get('common/citizenship_declaration'),
72
-                'veteran_status_template' => Lang::get('common/veteran_status'),
69
+                'preferred_language_template' => Lang::get ('common/preferred_language'),
70
+                'citizenship_declaration_template' => Lang::get ('common/citizenship_declaration'),
71
+                'veteran_status_template' => Lang::get ('common/veteran_status'),
73 72
                 // Job Data.
74 73
                 'job' => $application->job_poster,
75 74
                 // Skills Data.
76
-                'skills' => Skill::all(),
77
-                'skill_template' => Lang::get('common/skills'),
78
-                'reference_template' => Lang::get('common/references'),
79
-                'sample_template' => Lang::get('common/work_samples'),
75
+                'skills' => Skill::all (),
76
+                'skill_template' => Lang::get ('common/skills'),
77
+                'reference_template' => Lang::get ('common/references'),
78
+                'sample_template' => Lang::get ('common/work_samples'),
80 79
                 'criteria' => $criteria,
81 80
                 // Applicant Data.
82 81
                 'applicant' => $application->applicant,
83 82
                 'job_application' => $application,
84
-                'review_statuses' => ReviewStatus::all(),
83
+                'review_statuses' => ReviewStatus::all (),
85 84
             ]
86 85
         );
87 86
     }
@@ -95,16 +94,16 @@  discard block
 block discarded – undo
95 94
      */
96 95
     public function destroy(Request $request, JobApplication $application)
97 96
     {
98
-        $this->authorize('delete', $application);
97
+        $this->authorize ('delete', $application);
99 98
 
100
-        $application->delete();
99
+        $application->delete ();
101 100
 
102
-        if ($request->ajax()) {
101
+        if ($request->ajax ()) {
103 102
             return [
104 103
                 'message' => 'Application deleted'
105 104
             ];
106 105
         }
107 106
 
108
-        return redirect()->back();
107
+        return redirect ()->back ();
109 108
     }
110 109
 }
Please login to merge, or discard this patch.