@@ -27,11 +27,11 @@ |
||
27 | 27 | |
28 | 28 | public function skills() |
29 | 29 | { |
30 | - return $this->belongsToMany(\App\Models\Skill::class)->withTimestamps(); |
|
30 | + return $this->belongsToMany (\App\Models\Skill::class)->withTimestamps (); |
|
31 | 31 | } |
32 | 32 | |
33 | 33 | public function job_posters() //phpcs:ignore |
34 | 34 | { |
35 | - return $this->belongsToMany(\App\Models\JobPoster::class); |
|
35 | + return $this->belongsToMany (\App\Models\JobPoster::class); |
|
36 | 36 | } |
37 | 37 | } |
@@ -13,467 +13,467 @@ discard block |
||
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 | /* Non-Backpack Admin Portal (localized pages) =========================================================== */ |
411 | - Route::group( |
|
411 | + Route::group ( |
|
412 | 412 | [ |
413 | 413 | 'prefix' => 'admin', |
414 | 414 | 'middleware' => ['auth', 'role:admin'] |
415 | 415 | ], |
416 | 416 | function (): void { |
417 | 417 | /* Edit Job */ |
418 | - Route::get('jobs/{jobPoster}/edit', 'JobController@edit') |
|
419 | - ->where('jobPoster', '[0-9]+') |
|
420 | - ->middleware('can:update,jobPoster') |
|
421 | - ->name('admin.jobs.edit'); |
|
422 | - Route::post('jobs/{jobPoster}', 'JobController@store') |
|
423 | - ->where('jobPoster', '[0-9]+') |
|
424 | - ->middleware('can:update,jobPoster') |
|
425 | - ->name('admin.jobs.update'); |
|
418 | + Route::get ('jobs/{jobPoster}/edit', 'JobController@edit') |
|
419 | + ->where ('jobPoster', '[0-9]+') |
|
420 | + ->middleware ('can:update,jobPoster') |
|
421 | + ->name ('admin.jobs.edit'); |
|
422 | + Route::post ('jobs/{jobPoster}', 'JobController@store') |
|
423 | + ->where ('jobPoster', '[0-9]+') |
|
424 | + ->middleware ('can:update,jobPoster') |
|
425 | + ->name ('admin.jobs.update'); |
|
426 | 426 | } |
427 | 427 | ); |
428 | 428 | |
429 | 429 | /* HR Advisor Portal =========================================================== */ |
430 | 430 | |
431 | - Route::group([ |
|
432 | - 'prefix' => config('app.hr_prefix'), |
|
431 | + Route::group ([ |
|
432 | + 'prefix' => config ('app.hr_prefix'), |
|
433 | 433 | ], function (): void { |
434 | 434 | |
435 | - Route::middleware(['finishHrRegistration'])->group(function (): void { |
|
435 | + Route::middleware (['finishHrRegistration'])->group (function (): void { |
|
436 | 436 | |
437 | - Route::get('/', 'HomepageController@hr_advisor')->name('hr_advisor.home'); |
|
437 | + Route::get ('/', 'HomepageController@hr_advisor')->name ('hr_advisor.home'); |
|
438 | 438 | }); |
439 | 439 | |
440 | 440 | // These routes must be excluded from the finishHrAdvisorRegistration middleware to avoid an infinite loop of redirects |
441 | - Route::middleware(['auth', 'role:hr_advisor'])->group(function (): void { |
|
442 | - Route::get('first-visit', 'Auth\FirstVisitController@showFirstVisitHrForm') |
|
443 | - ->name('hr_advisor.first_visit'); |
|
444 | - Route::post('finish_registration', 'Auth\FirstVisitController@finishHrRegistration') |
|
445 | - ->name('hr_advisor.finish_registration'); |
|
441 | + Route::middleware (['auth', 'role:hr_advisor'])->group (function (): void { |
|
442 | + Route::get ('first-visit', 'Auth\FirstVisitController@showFirstVisitHrForm') |
|
443 | + ->name ('hr_advisor.first_visit'); |
|
444 | + Route::post ('finish_registration', 'Auth\FirstVisitController@finishHrRegistration') |
|
445 | + ->name ('hr_advisor.finish_registration'); |
|
446 | 446 | }); |
447 | 447 | |
448 | 448 | // Laravel default login, logout, register, and reset routes |
449 | - Route::get('login', 'Auth\LoginController@showLoginForm')->name('hr_advisor.login'); |
|
450 | - Route::post('login', 'Auth\LoginController@login')->name('hr_advisor.login.post'); |
|
451 | - Route::post('logout', 'Auth\LoginController@logout')->name('hr_advisor.logout'); |
|
449 | + Route::get ('login', 'Auth\LoginController@showLoginForm')->name ('hr_advisor.login'); |
|
450 | + Route::post ('login', 'Auth\LoginController@login')->name ('hr_advisor.login.post'); |
|
451 | + Route::post ('logout', 'Auth\LoginController@logout')->name ('hr_advisor.logout'); |
|
452 | 452 | |
453 | 453 | // Registration Routes... |
454 | - Route::get('register', 'Auth\RegisterController@showHrRegistrationForm')->name('hr_advisor.register'); |
|
455 | - Route::post('register', 'Auth\RegisterController@registerHrAdvisor')->name('hr_advisor.register.post'); |
|
454 | + Route::get ('register', 'Auth\RegisterController@showHrRegistrationForm')->name ('hr_advisor.register'); |
|
455 | + Route::post ('register', 'Auth\RegisterController@registerHrAdvisor')->name ('hr_advisor.register.post'); |
|
456 | 456 | |
457 | 457 | // Password Reset Routes... |
458 | - Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('hr_advisor.password.request'); |
|
459 | - Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('hr_advisor.password.email'); |
|
460 | - Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('hr_advisor.password.reset'); |
|
461 | - Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('hr_advisor.password.reset.post'); |
|
458 | + Route::get ('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name ('hr_advisor.password.request'); |
|
459 | + Route::post ('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name ('hr_advisor.password.email'); |
|
460 | + Route::get ('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name ('hr_advisor.password.reset'); |
|
461 | + Route::post ('password/reset', 'Auth\ResetPasswordController@reset')->name ('hr_advisor.password.reset.post'); |
|
462 | 462 | }); |
463 | 463 | } |
464 | 464 | ); |
465 | 465 | |
466 | 466 | /* Non-Backpack Admin Portal (non-localized pages) =========================================================== */ |
467 | -Route::group( |
|
467 | +Route::group ( |
|
468 | 468 | [ |
469 | 469 | 'prefix' => 'admin', |
470 | 470 | 'middleware' => ['auth', 'role:admin'] |
471 | 471 | ], |
472 | 472 | function (): void { |
473 | 473 | // This page is non-localized, because the middleware that redirects to localized pages changes POSTs to GETs and messes up the request. |
474 | - Route::post('jobs/create/as-manager/{manager}', 'JobController@createAsManager') |
|
475 | - ->middleware('can:create,App\Models\JobPoster') |
|
476 | - ->name('admin.jobs.create_as_manager'); |
|
474 | + Route::post ('jobs/create/as-manager/{manager}', 'JobController@createAsManager') |
|
475 | + ->middleware ('can:create,App\Models\JobPoster') |
|
476 | + ->name ('admin.jobs.create_as_manager'); |
|
477 | 477 | } |
478 | 478 | ); |
479 | 479 | |
@@ -483,85 +483,85 @@ discard block |
||
483 | 483 | |
484 | 484 | |
485 | 485 | /** API routes - currently using same default http auth, but not localized */ |
486 | -Route::group(['prefix' => 'api'], function (): void { |
|
486 | +Route::group (['prefix' => 'api'], function (): void { |
|
487 | 487 | // Protected by a gate in the controller, instead of policy middleware |
488 | - Route::get('jobs/{jobPoster}/assessment-plan', 'AssessmentPlanController@getForJob'); |
|
488 | + Route::get ('jobs/{jobPoster}/assessment-plan', 'AssessmentPlanController@getForJob'); |
|
489 | 489 | // Public, not protected by policy or gate |
490 | - Route::get('skills', 'Api\SkillController@index'); |
|
491 | - Route::get('departments', 'Api\DepartmentController@index'); |
|
490 | + Route::get ('skills', 'Api\SkillController@index'); |
|
491 | + Route::get ('departments', 'Api\DepartmentController@index'); |
|
492 | 492 | |
493 | 493 | // Resource Routes are protected by policies in controllers instead of middleware. |
494 | - Route::resource('assessments', 'AssessmentController')->except([ |
|
494 | + Route::resource ('assessments', 'AssessmentController')->except ([ |
|
495 | 495 | 'create', 'edit', 'index' |
496 | 496 | ]); |
497 | - Route::apiResource('rating-guide-answers', 'RatingGuideAnswerController')->except([ |
|
497 | + Route::apiResource ('rating-guide-answers', 'RatingGuideAnswerController')->except ([ |
|
498 | 498 | 'index' |
499 | - ])->parameters([ |
|
499 | + ])->parameters ([ |
|
500 | 500 | 'rating-guide-answers' => 'ratingGuideAnswer' |
501 | 501 | ]); |
502 | - Route::resource('rating-guide-questions', 'RatingGuideQuestionController')->except([ |
|
502 | + Route::resource ('rating-guide-questions', 'RatingGuideQuestionController')->except ([ |
|
503 | 503 | 'create', 'edit', 'index' |
504 | 504 | ]); |
505 | - Route::resource('assessment-plan-notifications', 'AssessmentPlanNotificationController')->except([ |
|
505 | + Route::resource ('assessment-plan-notifications', 'AssessmentPlanNotificationController')->except ([ |
|
506 | 506 | 'store', 'create', 'edit' |
507 | 507 | ]); |
508 | 508 | // TODO: add policy middleware |
509 | - Route::get('jobs/{jobPoster}/tasks', 'Api\JobTaskController@indexByJob') |
|
510 | - ->where('jobPoster', '[0-9]+') |
|
511 | - ->middleware('can:view,jobPoster'); |
|
512 | - Route::put('jobs/{jobPoster}/tasks', 'Api\JobTaskController@batchUpdate') |
|
513 | - ->where('jobPoster', '[0-9]+') |
|
514 | - ->middleware('can:update,jobPoster'); |
|
515 | - |
|
516 | - |
|
517 | - Route::get('jobs/{jobPoster}/criteria', 'Api\CriteriaController@indexByJob') |
|
518 | - ->where('jobPoster', '[0-9]+') |
|
519 | - ->middleware('can:view,jobPoster'); |
|
520 | - Route::put('jobs/{jobPoster}/criteria', 'Api\CriteriaController@batchUpdate') |
|
521 | - ->where('jobPoster', '[0-9]+') |
|
522 | - ->middleware('can:update,jobPoster'); |
|
523 | - |
|
524 | - |
|
525 | - Route::post('jobs/{job}/submit', 'Api\JobApiController@submitForReview') |
|
526 | - ->where('job', '[0-9]+') |
|
527 | - ->middleware('can:submitForReview,job') |
|
528 | - ->name('api.jobs.submit'); |
|
529 | - Route::resource('jobs', 'Api\JobApiController')->only([ |
|
509 | + Route::get ('jobs/{jobPoster}/tasks', 'Api\JobTaskController@indexByJob') |
|
510 | + ->where ('jobPoster', '[0-9]+') |
|
511 | + ->middleware ('can:view,jobPoster'); |
|
512 | + Route::put ('jobs/{jobPoster}/tasks', 'Api\JobTaskController@batchUpdate') |
|
513 | + ->where ('jobPoster', '[0-9]+') |
|
514 | + ->middleware ('can:update,jobPoster'); |
|
515 | + |
|
516 | + |
|
517 | + Route::get ('jobs/{jobPoster}/criteria', 'Api\CriteriaController@indexByJob') |
|
518 | + ->where ('jobPoster', '[0-9]+') |
|
519 | + ->middleware ('can:view,jobPoster'); |
|
520 | + Route::put ('jobs/{jobPoster}/criteria', 'Api\CriteriaController@batchUpdate') |
|
521 | + ->where ('jobPoster', '[0-9]+') |
|
522 | + ->middleware ('can:update,jobPoster'); |
|
523 | + |
|
524 | + |
|
525 | + Route::post ('jobs/{job}/submit', 'Api\JobApiController@submitForReview') |
|
526 | + ->where ('job', '[0-9]+') |
|
527 | + ->middleware ('can:submitForReview,job') |
|
528 | + ->name ('api.jobs.submit'); |
|
529 | + Route::resource ('jobs', 'Api\JobApiController')->only ([ |
|
530 | 530 | 'show', 'store', 'update' |
531 | - ])->names([ // Specify custom names because default names collied with existing routes. |
|
531 | + ])->names ([// Specify custom names because default names collied with existing routes. |
|
532 | 532 | 'show' => 'api.jobs.show', |
533 | 533 | 'store' => 'api.jobs.store', |
534 | 534 | 'update' => 'api.jobs.update' |
535 | 535 | ]); |
536 | 536 | |
537 | - Route::resource('managers', 'Api\ManagerApiController')->only([ |
|
537 | + Route::resource ('managers', 'Api\ManagerApiController')->only ([ |
|
538 | 538 | 'show', 'update' |
539 | - ])->names([ // Specify custom names because default names collied with existing routes |
|
539 | + ])->names ([// Specify custom names because default names collied with existing routes |
|
540 | 540 | 'show' => 'api.managers.show', |
541 | 541 | 'update' => 'api.managers.update' |
542 | 542 | ]); |
543 | 543 | |
544 | 544 | // User must be logged in to user currentuser routes |
545 | - Route::get('currentuser/manager', 'Api\ManagerApiController@showAuthenticated') |
|
546 | - ->middleware('auth'); |
|
545 | + Route::get ('currentuser/manager', 'Api\ManagerApiController@showAuthenticated') |
|
546 | + ->middleware ('auth'); |
|
547 | 547 | |
548 | 548 | // Claim / unclaim job routes, HR portal |
549 | - Route::put('jobs/{job}/claim', 'Api\ClaimJobApiController@store') |
|
550 | - ->middleware('can:claim,job') |
|
551 | - ->where('job', '[0-9]+'); |
|
552 | - Route::delete('jobs/{job}/claim', 'Api\ClaimJobApiController@destroy') |
|
553 | - ->middleware('can:unClaim,job') |
|
554 | - ->where('job', '[0-9]+'); |
|
555 | - |
|
556 | - Route::get('hr-advisors/{hrAdvisor}', 'Api\HrAdvisorController@show') |
|
557 | - ->middleware('can:view,hrAdvisor'); |
|
558 | - |
|
559 | - Route::put('hr-advisors/{hrAdvisor}/claims/{job}', 'Api\ClaimJobApiController@claimJob') |
|
560 | - ->middleware('can:update,hrAdvisor') |
|
561 | - ->where('hrAdvisor', '[0-9]+') |
|
562 | - ->where('job', '[0-9]+'); |
|
563 | - Route::delete('hr-advisors/{hrAdvisor}/claims/{job}', 'Api\ClaimJobApiController@unclaimJob') |
|
564 | - ->middleware('can:update,hrAdvisor') |
|
565 | - ->where('hrAdvisor', '[0-9]+') |
|
566 | - ->where('job', '[0-9]+'); |
|
549 | + Route::put ('jobs/{job}/claim', 'Api\ClaimJobApiController@store') |
|
550 | + ->middleware ('can:claim,job') |
|
551 | + ->where ('job', '[0-9]+'); |
|
552 | + Route::delete ('jobs/{job}/claim', 'Api\ClaimJobApiController@destroy') |
|
553 | + ->middleware ('can:unClaim,job') |
|
554 | + ->where ('job', '[0-9]+'); |
|
555 | + |
|
556 | + Route::get ('hr-advisors/{hrAdvisor}', 'Api\HrAdvisorController@show') |
|
557 | + ->middleware ('can:view,hrAdvisor'); |
|
558 | + |
|
559 | + Route::put ('hr-advisors/{hrAdvisor}/claims/{job}', 'Api\ClaimJobApiController@claimJob') |
|
560 | + ->middleware ('can:update,hrAdvisor') |
|
561 | + ->where ('hrAdvisor', '[0-9]+') |
|
562 | + ->where ('job', '[0-9]+'); |
|
563 | + Route::delete ('hr-advisors/{hrAdvisor}/claims/{job}', 'Api\ClaimJobApiController@unclaimJob') |
|
564 | + ->middleware ('can:update,hrAdvisor') |
|
565 | + ->where ('hrAdvisor', '[0-9]+') |
|
566 | + ->where ('job', '[0-9]+'); |
|
567 | 567 | }); |
@@ -16,11 +16,11 @@ |
||
16 | 16 | */ |
17 | 17 | public function view(User $user, HrAdvisor $hrAdvisor) |
18 | 18 | { |
19 | - return $user->isHrAdvisor() && $hrAdvisor->user_id === $user->id; |
|
19 | + return $user->isHrAdvisor () && $hrAdvisor->user_id === $user->id; |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | public function update(User $user, HrAdvisor $hrAdvisor) |
23 | 23 | { |
24 | - return $user->isHrAdvisor() && $hrAdvisor->user_id === $user->id; |
|
24 | + return $user->isHrAdvisor () && $hrAdvisor->user_id === $user->id; |
|
25 | 25 | } |
26 | 26 | } |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | |
53 | 53 | public function user() |
54 | 54 | { |
55 | - return $this->belongsTo(\App\Models\User::class); |
|
55 | + return $this->belongsTo (\App\Models\User::class); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | public function department() |
59 | 59 | { |
60 | - return $this->belongsTo(\App\Models\Lookup\Department::class); |
|
60 | + return $this->belongsTo (\App\Models\Lookup\Department::class); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | public function claimed_jobs() |
64 | 64 | { |
65 | - return $this->belongsToMany( |
|
65 | + return $this->belongsToMany ( |
|
66 | 66 | \App\Models\JobPoster::class, |
67 | 67 | 'claimed_jobs' |
68 | 68 | ); |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | public function getNameAttribute(): string |
77 | 77 | { |
78 | 78 | if ($this->user !== null) { |
79 | - return $this->user->first_name . ' ' . $this->user->last_name; |
|
79 | + return $this->user->first_name.' '.$this->user->last_name; |
|
80 | 80 | } |
81 | 81 | return ''; |
82 | 82 | } |
@@ -88,6 +88,6 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function getClaimedJobIdsAttribute() |
90 | 90 | { |
91 | - return $this->claimed_jobs()->allRelatedIds()->toArray(); |
|
91 | + return $this->claimed_jobs ()->allRelatedIds ()->toArray (); |
|
92 | 92 | } |
93 | 93 | } |
@@ -273,42 +273,42 @@ discard block |
||
273 | 273 | // @codeCoverageIgnoreStart |
274 | 274 | public function department() // phpcs:ignore |
275 | 275 | { |
276 | - return $this->belongsTo(\App\Models\Lookup\Department::class); |
|
276 | + return $this->belongsTo (\App\Models\Lookup\Department::class); |
|
277 | 277 | } |
278 | 278 | |
279 | 279 | public function job_term() // phpcs:ignore |
280 | 280 | { |
281 | - return $this->belongsTo(\App\Models\Lookup\JobTerm::class); |
|
281 | + return $this->belongsTo (\App\Models\Lookup\JobTerm::class); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | public function language_requirement() // phpcs:ignore |
285 | 285 | { |
286 | - return $this->belongsTo(\App\Models\Lookup\LanguageRequirement::class); |
|
286 | + return $this->belongsTo (\App\Models\Lookup\LanguageRequirement::class); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | public function manager() // phpcs:ignore |
290 | 290 | { |
291 | - return $this->belongsTo(\App\Models\Manager::class); |
|
291 | + return $this->belongsTo (\App\Models\Manager::class); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | public function province() // phpcs:ignore |
295 | 295 | { |
296 | - return $this->belongsTo(\App\Models\Lookup\Province::class); |
|
296 | + return $this->belongsTo (\App\Models\Lookup\Province::class); |
|
297 | 297 | } |
298 | 298 | |
299 | 299 | public function security_clearance() // phpcs:ignore |
300 | 300 | { |
301 | - return $this->belongsTo(\App\Models\Lookup\SecurityClearance::class); |
|
301 | + return $this->belongsTo (\App\Models\Lookup\SecurityClearance::class); |
|
302 | 302 | } |
303 | 303 | |
304 | 304 | public function criteria() // phpcs:ignore |
305 | 305 | { |
306 | - return $this->hasMany(\App\Models\Criteria::class); |
|
306 | + return $this->hasMany (\App\Models\Criteria::class); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | public function hr_advisors() // phpcs:ignore |
310 | 310 | { |
311 | - return $this->belongsToMany( |
|
311 | + return $this->belongsToMany ( |
|
312 | 312 | \App\Models\HrAdvisor::class, |
313 | 313 | 'claimed_jobs' |
314 | 314 | ); |
@@ -316,47 +316,47 @@ discard block |
||
316 | 316 | |
317 | 317 | public function job_applications() // phpcs:ignore |
318 | 318 | { |
319 | - return $this->hasMany(\App\Models\JobApplication::class); |
|
319 | + return $this->hasMany (\App\Models\JobApplication::class); |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | public function job_poster_key_tasks() // phpcs:ignore |
323 | 323 | { |
324 | - return $this->hasMany(\App\Models\JobPosterKeyTask::class); |
|
324 | + return $this->hasMany (\App\Models\JobPosterKeyTask::class); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | public function job_poster_questions() // phpcs:ignore |
328 | 328 | { |
329 | - return $this->hasMany(\App\Models\JobPosterQuestion::class); |
|
329 | + return $this->hasMany (\App\Models\JobPosterQuestion::class); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | public function job_poster_translations() // phpcs:ignore |
333 | 333 | { |
334 | - return $this->hasMany(\App\Models\JobPosterTranslation::class); |
|
334 | + return $this->hasMany (\App\Models\JobPosterTranslation::class); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | public function telework_allowed_frequency() // phpcs:ignore |
338 | 338 | { |
339 | - return $this->belongsTo(\App\Models\Lookup\Frequency::class); |
|
339 | + return $this->belongsTo (\App\Models\Lookup\Frequency::class); |
|
340 | 340 | } |
341 | 341 | |
342 | 342 | public function flexible_hours_frequency() // phpcs:ignore |
343 | 343 | { |
344 | - return $this->belongsTo(\App\Models\Lookup\Frequency::class); |
|
344 | + return $this->belongsTo (\App\Models\Lookup\Frequency::class); |
|
345 | 345 | } |
346 | 346 | |
347 | 347 | public function travel_requirement() // phpcs:ignore |
348 | 348 | { |
349 | - return $this->belongsTo(\App\Models\Lookup\TravelRequirement::class); |
|
349 | + return $this->belongsTo (\App\Models\Lookup\TravelRequirement::class); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | public function overtime_requirement() // phpcs:ignore |
353 | 353 | { |
354 | - return $this->belongsTo(\App\Models\Lookup\OvertimeRequirement::class); |
|
354 | + return $this->belongsTo (\App\Models\Lookup\OvertimeRequirement::class); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | public function classification() // phpcs:ignore |
358 | 358 | { |
359 | - return $this->belongsTo(\App\Models\Classification::class); |
|
359 | + return $this->belongsTo (\App\Models\Classification::class); |
|
360 | 360 | } |
361 | 361 | // @codeCoverageIgnoreEnd |
362 | 362 | /* Artificial Relations */ |
@@ -369,8 +369,8 @@ discard block |
||
369 | 369 | */ |
370 | 370 | public function submitted_applications() // phpcs:ignore |
371 | 371 | { |
372 | - return $this->hasMany(\App\Models\JobApplication::class)->whereDoesntHave('application_status', function ($query): void { |
|
373 | - $query->where('name', 'draft'); |
|
372 | + return $this->hasMany (\App\Models\JobApplication::class)->whereDoesntHave ('application_status', function ($query): void { |
|
373 | + $query->where ('name', 'draft'); |
|
374 | 374 | }); |
375 | 375 | } |
376 | 376 | |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | */ |
390 | 390 | public function resolveRouteBinding($value) // phpcs:ignore |
391 | 391 | { |
392 | - return $this->withCount('submitted_applications')->where('id', $value)->first() ?? abort(404); |
|
392 | + return $this->withCount ('submitted_applications')->where ('id', $value)->first () ?? abort (404); |
|
393 | 393 | } |
394 | 394 | |
395 | 395 | /** |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | public function setPublishedAttribute($value): void |
404 | 404 | { |
405 | 405 | if ($value) { |
406 | - $this->attributes['published_at'] = new Date(); |
|
406 | + $this->attributes['published_at'] = new Date (); |
|
407 | 407 | } else { |
408 | 408 | $this->attributes['published_at'] = null; |
409 | 409 | } |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | |
418 | 418 | public function submitted_applications_count() //phpcs:ignore |
419 | 419 | { |
420 | - return $this->submitted_applications()->count(); |
|
420 | + return $this->submitted_applications ()->count (); |
|
421 | 421 | } |
422 | 422 | |
423 | 423 | /** |
@@ -427,15 +427,15 @@ discard block |
||
427 | 427 | */ |
428 | 428 | public function applyBy(): array |
429 | 429 | { |
430 | - $localCloseDate = new Date($this->close_date_time); // This initializes the date object in UTC time. |
|
431 | - $localCloseDate->setTimezone(new \DateTimeZone(self::TIMEZONE)); // Then set the time zone for display. |
|
430 | + $localCloseDate = new Date ($this->close_date_time); // This initializes the date object in UTC time. |
|
431 | + $localCloseDate->setTimezone (new \DateTimeZone (self::TIMEZONE)); // Then set the time zone for display. |
|
432 | 432 | $displayDate = [ |
433 | - 'date' => $localCloseDate->format(self::DATE_FORMAT[App::getLocale()]), |
|
434 | - 'time' => $localCloseDate->format(self::TIME_FORMAT[App::getLocale()]) |
|
433 | + 'date' => $localCloseDate->format (self::DATE_FORMAT[App::getLocale ()]), |
|
434 | + 'time' => $localCloseDate->format (self::TIME_FORMAT[App::getLocale ()]) |
|
435 | 435 | ]; |
436 | 436 | |
437 | - if (App::isLocale('fr')) { |
|
438 | - $displayDate['time'] = str_replace(['EST', 'EDT'], ['HNE', 'HAE'], $displayDate['time']); |
|
437 | + if (App::isLocale ('fr')) { |
|
438 | + $displayDate['time'] = str_replace (['EST', 'EDT'], ['HNE', 'HAE'], $displayDate['time']); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | return $displayDate; |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | */ |
450 | 450 | public function displayStatus(): string |
451 | 451 | { |
452 | - return $this->isOpen() ? 'Open' : 'Closed'; |
|
452 | + return $this->isOpen () ? 'Open' : 'Closed'; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | /** |
@@ -462,8 +462,8 @@ discard block |
||
462 | 462 | return $this->published |
463 | 463 | && $this->open_date_time !== null |
464 | 464 | && $this->close_date_time !== null |
465 | - && $this->open_date_time->isPast() |
|
466 | - && $this->close_date_time->isFuture(); |
|
465 | + && $this->open_date_time->isPast () |
|
466 | + && $this->close_date_time->isFuture (); |
|
467 | 467 | } |
468 | 468 | |
469 | 469 | /** |
@@ -476,8 +476,8 @@ discard block |
||
476 | 476 | return $this->published |
477 | 477 | && $this->open_date_time !== null |
478 | 478 | && $this->close_date_time !== null |
479 | - && $this->open_date_time->isPast() |
|
480 | - && $this->close_date_time->isPast(); |
|
479 | + && $this->open_date_time->isPast () |
|
480 | + && $this->close_date_time->isPast (); |
|
481 | 481 | } |
482 | 482 | |
483 | 483 | /** |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | */ |
488 | 488 | public function timeRemaining(): string |
489 | 489 | { |
490 | - $interval = $this->close_date_time->diff(Date::now()); |
|
490 | + $interval = $this->close_date_time->diff (Date::now ()); |
|
491 | 491 | |
492 | 492 | $d = $interval->d; |
493 | 493 | $h = $interval->h; |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | |
511 | 511 | $key = "common/time.$unit"; |
512 | 512 | |
513 | - return Lang::choice($key, $count); |
|
513 | + return Lang::choice ($key, $count); |
|
514 | 514 | } |
515 | 515 | |
516 | 516 | /** |
@@ -522,9 +522,9 @@ discard block |
||
522 | 522 | public function status(): string |
523 | 523 | { |
524 | 524 | $status = 'draft'; |
525 | - if ($this->isOpen()) { |
|
525 | + if ($this->isOpen ()) { |
|
526 | 526 | $status = 'published'; |
527 | - } elseif ($this->isClosed()) { |
|
527 | + } elseif ($this->isClosed ()) { |
|
528 | 528 | $status = 'closed'; |
529 | 529 | } elseif ($this->review_requested_at !== null) { |
530 | 530 | $status = 'submitted'; |
@@ -558,7 +558,7 @@ discard block |
||
558 | 558 | public function getClassificationMessageAttribute() |
559 | 559 | { |
560 | 560 | if ($this->classification_id !== null && $this->classification_level !== null) { |
561 | - return $this->classification->key . '-0' . $this->classification_level; |
|
561 | + return $this->classification->key.'-0'.$this->classification_level; |
|
562 | 562 | } |
563 | 563 | return null; |
564 | 564 | } |
@@ -571,7 +571,7 @@ discard block |
||
571 | 571 | */ |
572 | 572 | public function toApiArray(): array |
573 | 573 | { |
574 | - $jobWithTranslations = array_merge($this->toArray(), $this->getTranslationsArray()); |
|
574 | + $jobWithTranslations = array_merge ($this->toArray (), $this->getTranslationsArray ()); |
|
575 | 575 | return $jobWithTranslations; |
576 | 576 | } |
577 | 577 | } |
@@ -23,26 +23,26 @@ discard block |
||
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 |
||
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->translate($chosen_lang)->title; |
|
69 | + $job->title = $job->translate ($chosen_lang)->title; |
|
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 |
||
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 |
||
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 |
||
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( |
|
129 | - function ($value, $key) { |
|
128 | + 'essential' => $jobPoster->criteria->filter ( |
|
129 | + function ($value, $key){ |
|
130 | 130 | return $value->criteria_type->name == 'essential'; |
131 | 131 | } |
132 | 132 | ), |
133 | - 'asset' => $jobPoster->criteria->filter( |
|
134 | - function ($value, $key) { |
|
133 | + 'asset' => $jobPoster->criteria->filter ( |
|
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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->translate('en') !== null ? $manager->translate('en')->division : null; |
|
251 | - $divisionFr = $manager->translate('fr') !== null ? $manager->translate('fr')->division : null; |
|
252 | - $jobPoster->fill([ |
|
250 | + $divisionEn = $manager->translate ('en') !== null ? $manager->translate ('en')->division : null; |
|
251 | + $divisionFr = $manager->translate ('fr') !== null ? $manager->translate ('fr')->division : null; |
|
252 | + $jobPoster->fill ([ |
|
253 | 253 | 'department_id' => $manager->department_id, |
254 | 254 | 'en' => ['division' => $divisionEn], |
255 | 255 | 'fr' => ['division' => $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 |
||
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 |
||
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 | 'en' => [ |
314 | 314 | 'question' => $question['question']['en'], |
@@ -320,8 +320,8 @@ discard block |
||
320 | 320 | ] |
321 | 321 | ] |
322 | 322 | ); |
323 | - $jobPoster->save(); |
|
324 | - $jobQuestion->save(); |
|
323 | + $jobPoster->save (); |
|
324 | + $jobQuestion->save (); |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | |
@@ -333,20 +333,20 @@ discard block |
||
333 | 333 | protected function populateDefaultQuestions() |
334 | 334 | { |
335 | 335 | $defaultQuestions = [ |
336 | - 'en' => array_values(Lang::get('manager/job_create', [], 'en')['questions']), |
|
337 | - 'fr' => array_values(Lang::get('manager/job_create', [], 'fr')['questions']), |
|
336 | + 'en' => array_values (Lang::get ('manager/job_create', [], 'en')['questions']), |
|
337 | + 'fr' => array_values (Lang::get ('manager/job_create', [], 'fr')['questions']), |
|
338 | 338 | ]; |
339 | 339 | |
340 | - if (count($defaultQuestions['en']) !== count($defaultQuestions['fr'])) { |
|
341 | - Log::warning('There must be the same number of French and English default questions for a Job Poster.'); |
|
340 | + if (count ($defaultQuestions['en']) !== count ($defaultQuestions['fr'])) { |
|
341 | + Log::warning ('There must be the same number of French and English default questions for a Job Poster.'); |
|
342 | 342 | return; |
343 | 343 | } |
344 | 344 | |
345 | 345 | $jobQuestions = []; |
346 | 346 | |
347 | - for ($i = 0; $i < count($defaultQuestions['en']); $i++) { |
|
348 | - $jobQuestion = new JobPosterQuestion(); |
|
349 | - $jobQuestion->fill( |
|
347 | + for ($i = 0; $i < count ($defaultQuestions['en']); $i++) { |
|
348 | + $jobQuestion = new JobPosterQuestion (); |
|
349 | + $jobQuestion->fill ( |
|
350 | 350 | [ |
351 | 351 | 'en' => [ |
352 | 352 | 'question' => $defaultQuestions['en'][$i], |
@@ -15,6 +15,6 @@ |
||
15 | 15 | */ |
16 | 16 | public function show(HrAdvisor $hrAdvisor) |
17 | 17 | { |
18 | - return response()->json($hrAdvisor->toArray()); |
|
18 | + return response ()->json ($hrAdvisor->toArray ()); |
|
19 | 19 | } |
20 | 20 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | */ |
25 | 25 | public function authorize(): bool |
26 | 26 | { |
27 | - $job = $this->route('job'); |
|
27 | + $job = $this->route ('job'); |
|
28 | 28 | // Published jobs cannot be updated. |
29 | 29 | return $job && $job->published_at === null; |
30 | 30 | } |
@@ -36,23 +36,23 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function rules(): array |
38 | 38 | { |
39 | - $dateFormat = Config::get('app.api_datetime_format'); |
|
39 | + $dateFormat = Config::get ('app.api_datetime_format'); |
|
40 | 40 | $dateFormatRule = "date_format:$dateFormat"; |
41 | 41 | $sliderRule = 'between:1,4'; |
42 | 42 | return [ |
43 | - 'chosen_lang' => ['nullable', Rule::in(['en', 'fr'])], |
|
43 | + 'chosen_lang' => ['nullable', Rule::in (['en', 'fr'])], |
|
44 | 44 | 'term_qty' => 'nullable|numeric', |
45 | 45 | 'open_date_time' =>['nullable', $dateFormatRule], |
46 | 46 | 'close_date_time' => ['nullable', $dateFormatRule], |
47 | 47 | 'start_date_time' =>['nullable', $dateFormatRule], |
48 | - 'department_id' => ['nullable', new ValidIdRule(Department::class)], |
|
49 | - 'province_id' => ['nullable', new ValidIdRule(Province::class)], |
|
50 | - 'security_clearance_id' => ['nullable', new ValidIdRule(SecurityClearance::class)], |
|
51 | - 'language_requirement_id' => ['nullable', new ValidIdRule(LanguageRequirement::class)], |
|
48 | + 'department_id' => ['nullable', new ValidIdRule (Department::class)], |
|
49 | + 'province_id' => ['nullable', new ValidIdRule (Province::class)], |
|
50 | + 'security_clearance_id' => ['nullable', new ValidIdRule (SecurityClearance::class)], |
|
51 | + 'language_requirement_id' => ['nullable', new ValidIdRule (LanguageRequirement::class)], |
|
52 | 52 | 'salary_min' => 'nullable|numeric', |
53 | 53 | 'salary_max' => 'nullable|numeric', |
54 | 54 | 'noc' => 'nullable|numeric', |
55 | - 'classification_id' => ['nullable', new ValidIdRule(Classification::class)], |
|
55 | + 'classification_id' => ['nullable', new ValidIdRule (Classification::class)], |
|
56 | 56 | 'classification_level' => 'nullable|numeric', |
57 | 57 | 'remote_work_allowed' => 'nullable|boolean', |
58 | 58 | 'team_size' => 'nullable|numeric', |
@@ -63,10 +63,10 @@ discard block |
||
63 | 63 | 'experimental_vs_ongoing' => ['nullable', $sliderRule], |
64 | 64 | 'citizen_facing_vs_back_office' => ['nullable', $sliderRule], |
65 | 65 | 'collaborative_vs_independent' => ['nullable', $sliderRule], |
66 | - 'telework_allowed_frequency_id' => ['nullable', new ValidIdRule(Frequency::class)], |
|
67 | - 'flexible_hours_frequency_id' => ['nullable', new ValidIdRule(Frequency::class)], |
|
68 | - 'travel_requirement_id' => ['nullable', new ValidIdRule(TravelRequirement::class)], |
|
69 | - 'overtime_requirement_id' => ['nullable', new ValidIdRule(OvertimeRequirement::class)], |
|
66 | + 'telework_allowed_frequency_id' => ['nullable', new ValidIdRule (Frequency::class)], |
|
67 | + 'flexible_hours_frequency_id' => ['nullable', new ValidIdRule (Frequency::class)], |
|
68 | + 'travel_requirement_id' => ['nullable', new ValidIdRule (TravelRequirement::class)], |
|
69 | + 'overtime_requirement_id' => ['nullable', new ValidIdRule (OvertimeRequirement::class)], |
|
70 | 70 | 'en.city' => 'nullable|string', |
71 | 71 | 'en.title' => 'nullable|string', |
72 | 72 | 'en.dept_impact' => 'nullable|string', |
@@ -22,51 +22,51 @@ |
||
22 | 22 | */ |
23 | 23 | public function handle($request, Closure $next) |
24 | 24 | { |
25 | - if (Auth::check()) { |
|
26 | - $user = Auth::user(); |
|
25 | + if (Auth::check ()) { |
|
26 | + $user = Auth::user (); |
|
27 | 27 | |
28 | 28 | // If running in a local environment, and FORCE_ADMIN is true, |
29 | 29 | // automatically set any logged in user to (temporarilly) be an admin |
30 | - if (App::environment() == 'local' && Config::get('app.force_admin')) { |
|
31 | - $user->setRole('admin'); |
|
32 | - $user->save(); |
|
30 | + if (App::environment () == 'local' && Config::get ('app.force_admin')) { |
|
31 | + $user->setRole ('admin'); |
|
32 | + $user->save (); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | // Ensure the user has a proper profile associated with it |
36 | 36 | // If no profile exists yet create one. |
37 | 37 | // Admins should be given an applicant and manager profile |
38 | - if ($user->isApplicant() || |
|
39 | - $user->isAdmin() ) { |
|
38 | + if ($user->isApplicant () || |
|
39 | + $user->isAdmin ()) { |
|
40 | 40 | $applicantProfile = $user->applicant; |
41 | 41 | if ($applicantProfile === null) { |
42 | - $applicantProfile = new Applicant(); |
|
42 | + $applicantProfile = new Applicant (); |
|
43 | 43 | $applicantProfile->user_id = $user->id; |
44 | - $applicantProfile->save(); |
|
45 | - $user->refresh(); |
|
44 | + $applicantProfile->save (); |
|
45 | + $user->refresh (); |
|
46 | 46 | } |
47 | 47 | } |
48 | - if ($user->isManager() || |
|
49 | - $user->isAdmin()) { |
|
48 | + if ($user->isManager () || |
|
49 | + $user->isAdmin ()) { |
|
50 | 50 | $managerProfile = $user->manager; |
51 | 51 | if ($managerProfile === null) { |
52 | - $managerProfile = new Manager(); |
|
52 | + $managerProfile = new Manager (); |
|
53 | 53 | $managerProfile->user_id = $user->id; |
54 | - $managerProfile->save(); |
|
55 | - $user->refresh(); |
|
54 | + $managerProfile->save (); |
|
55 | + $user->refresh (); |
|
56 | 56 | } |
57 | 57 | } |
58 | - if ($user->isHrAdvisor() || |
|
59 | - $user->isAdmin()) { |
|
58 | + if ($user->isHrAdvisor () || |
|
59 | + $user->isAdmin ()) { |
|
60 | 60 | $hrAdvisorProfile = $user->hr_advisor; |
61 | 61 | if ($hrAdvisorProfile === null) { |
62 | - $hrAdvisorProfile = new HrAdvisor(); |
|
62 | + $hrAdvisorProfile = new HrAdvisor (); |
|
63 | 63 | $hrAdvisorProfile->user_id = $user->id; |
64 | - $hrAdvisorProfile->save(); |
|
65 | - $user->refresh(); |
|
64 | + $hrAdvisorProfile->save (); |
|
65 | + $user->refresh (); |
|
66 | 66 | } |
67 | 67 | } |
68 | 68 | } |
69 | 69 | |
70 | - return $next($request); |
|
70 | + return $next ($request); |
|
71 | 71 | } |
72 | 72 | } |