@@ -14,11 +14,11 @@ |
||
14 | 14 | */ |
15 | 15 | public function __invoke() |
16 | 16 | { |
17 | - return view( |
|
17 | + return view ( |
|
18 | 18 | 'applicant/static_faq', |
19 | 19 | [ |
20 | - 'faq' => Lang::get('applicant/faq'), |
|
21 | - 'breadcrumb_home' => route('home'), |
|
20 | + 'faq' => Lang::get ('applicant/faq'), |
|
21 | + 'breadcrumb_home' => route ('home'), |
|
22 | 22 | 'applicant_sidebar_active' => 'active', |
23 | 23 | ] |
24 | 24 | ); |
@@ -19,29 +19,29 @@ |
||
19 | 19 | */ |
20 | 20 | public function updateForApplication(Request $request, JobApplication $application) |
21 | 21 | { |
22 | - $request->validate([ |
|
22 | + $request->validate ([ |
|
23 | 23 | 'review_status_id' => [ |
24 | 24 | 'nullable', |
25 | - Rule::in(ReviewStatus::all()->pluck('id')->toArray()) |
|
25 | + Rule::in (ReviewStatus::all ()->pluck ('id')->toArray ()) |
|
26 | 26 | ], |
27 | 27 | 'notes' => 'nullable|string' |
28 | 28 | ]); |
29 | 29 | |
30 | 30 | $review = $application->application_review; |
31 | 31 | if ($review === null) { |
32 | - $review = new ApplicationReview(); |
|
33 | - $review->job_application()->associate($application); |
|
32 | + $review = new ApplicationReview (); |
|
33 | + $review->job_application ()->associate ($application); |
|
34 | 34 | } |
35 | - $review->fill([ |
|
36 | - 'review_status_id' => $request->input('review_status_id'), |
|
37 | - 'notes' => $request->input('notes'), |
|
35 | + $review->fill ([ |
|
36 | + 'review_status_id' => $request->input ('review_status_id'), |
|
37 | + 'notes' => $request->input ('notes'), |
|
38 | 38 | ]); |
39 | - $review->save(); |
|
39 | + $review->save (); |
|
40 | 40 | |
41 | - if ($request->ajax()) { |
|
42 | - return $review->fresh()->toJson(); |
|
41 | + if ($request->ajax ()) { |
|
42 | + return $review->fresh ()->toJson (); |
|
43 | 43 | } |
44 | 44 | |
45 | - return redirect()->back(); |
|
45 | + return redirect ()->back (); |
|
46 | 46 | } |
47 | 47 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | protected function redirectTo() |
46 | 46 | { |
47 | - $redirectTo = WhichPortal::isManagerPortal() ? route('manager.home') : route('home'); |
|
47 | + $redirectTo = WhichPortal::isManagerPortal () ? route('manager.home') : route ('home'); |
|
48 | 48 | return $redirectTo; |
49 | 49 | } |
50 | 50 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function __construct() |
57 | 57 | { |
58 | - $this->middleware('guest')->except('logout'); |
|
58 | + $this->middleware ('guest')->except ('logout'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function showLoginForm() |
68 | 68 | { |
69 | - $home_url = WhichPortal::isManagerPortal() ? route('manager.home') : route('home'); |
|
69 | + $home_url = WhichPortal::isManagerPortal () ? route('manager.home') : route ('home'); |
|
70 | 70 | |
71 | - return view('auth/login', [ |
|
72 | - 'routes' => $this->auth_routes(), |
|
73 | - 'login' => Lang::get('common/auth/login'), |
|
71 | + return view ('auth/login', [ |
|
72 | + 'routes' => $this->auth_routes (), |
|
73 | + 'login' => Lang::get ('common/auth/login'), |
|
74 | 74 | 'home_url' => $home_url, |
75 | 75 | ]); |
76 | 76 | } |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function logout(Request $request) |
86 | 86 | { |
87 | - $this->guard()->logout(); |
|
87 | + $this->guard ()->logout (); |
|
88 | 88 | |
89 | - $request->session()->invalidate(); |
|
89 | + $request->session ()->invalidate (); |
|
90 | 90 | |
91 | 91 | // This causes logout to redirect to the same page as login. |
92 | - return redirect($this->redirectPath()); |
|
92 | + return redirect ($this->redirectPath ()); |
|
93 | 93 | } |
94 | 94 | } |
@@ -14,25 +14,25 @@ |
||
14 | 14 | */ |
15 | 15 | protected function auth_routes() |
16 | 16 | { |
17 | - if (WhichPortal::isManagerPortal()) { |
|
17 | + if (WhichPortal::isManagerPortal ()) { |
|
18 | 18 | $routes = [ |
19 | - 'home' => route('manager.home'), |
|
20 | - 'login' => route('manager.login'), |
|
21 | - 'register' => route('manager.register'), |
|
19 | + 'home' => route ('manager.home'), |
|
20 | + 'login' => route ('manager.login'), |
|
21 | + 'register' => route ('manager.register'), |
|
22 | 22 | 'password' => [ |
23 | - 'email' => route('manager.password.email'), |
|
24 | - 'request' => route('manager.password.request'), |
|
23 | + 'email' => route ('manager.password.email'), |
|
24 | + 'request' => route ('manager.password.request'), |
|
25 | 25 | ], |
26 | 26 | // 'passwords.reset' => route('manager.password.reset'), |
27 | 27 | ]; |
28 | 28 | } else { |
29 | 29 | $routes = [ |
30 | - 'home' => route('home'), |
|
31 | - 'login' => route('login'), |
|
32 | - 'register' => route('register'), |
|
30 | + 'home' => route ('home'), |
|
31 | + 'login' => route ('login'), |
|
32 | + 'register' => route ('register'), |
|
33 | 33 | 'password' => [ |
34 | - 'email' => route('password.email'), |
|
35 | - 'request' => route('password.request'), |
|
34 | + 'email' => route ('password.email'), |
|
35 | + 'request' => route ('password.request'), |
|
36 | 36 | ], |
37 | 37 | // 'passwords.reset' => route('password.reset'), |
38 | 38 | ]; |
@@ -20,15 +20,15 @@ discard block |
||
20 | 20 | public function showFirstVisitManagerForm() |
21 | 21 | { |
22 | 22 | $routes = [ |
23 | - 'return' => route('home'), |
|
24 | - 'continue' => route('manager.finish_registration'), |
|
23 | + 'return' => route ('home'), |
|
24 | + 'continue' => route ('manager.finish_registration'), |
|
25 | 25 | ]; |
26 | 26 | |
27 | - return view('auth.first_visit_manager', [ |
|
27 | + return view ('auth.first_visit_manager', [ |
|
28 | 28 | 'routes' => $routes, |
29 | - 'first_visit' => Lang::get('common/auth/first_manager_visit'), |
|
30 | - 'departments' => Department::all(), |
|
31 | - 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')], |
|
29 | + 'first_visit' => Lang::get ('common/auth/first_manager_visit'), |
|
30 | + 'departments' => Department::all (), |
|
31 | + 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')], |
|
32 | 32 | ]); |
33 | 33 | } |
34 | 34 | |
@@ -40,34 +40,34 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function finishManagerRegistration(Request $request) |
42 | 42 | { |
43 | - $data = $request->all(); |
|
44 | - $validator = RegistrationValidator::finalizeManagerValidator($data); |
|
45 | - $validator->validate(); |
|
43 | + $data = $request->all (); |
|
44 | + $validator = RegistrationValidator::finalizeManagerValidator ($data); |
|
45 | + $validator->validate (); |
|
46 | 46 | |
47 | - $user = $request->user(); |
|
47 | + $user = $request->user (); |
|
48 | 48 | |
49 | 49 | // Save manager specific fields to user |
50 | - $managerDepartment = Department::find($data['department']); |
|
50 | + $managerDepartment = Department::find ($data['department']); |
|
51 | 51 | $inGovernment = ($managerDepartment !== null); |
52 | 52 | $user->not_in_gov = !$inGovernment; |
53 | 53 | $user->gov_email = $inGovernment ? $data['gov_email'] : null; |
54 | - $user->save(); |
|
55 | - $user->refresh(); |
|
54 | + $user->save (); |
|
55 | + $user->refresh (); |
|
56 | 56 | |
57 | 57 | // Add (or update) manager profile |
58 | 58 | // NOTE: modifying a field in $user, and saving it, appears to create Manager object. I don't know how. -- Tristan |
59 | 59 | // That means that after setting not_in_gov or gov_email, a manager already exists here. Adding a new one will throw an exception. |
60 | 60 | $department_id = $inGovernment ? $managerDepartment->id : null; |
61 | 61 | if ($user->manager === null) { |
62 | - $user->applicant()->save(new Manager()); |
|
63 | - $user->refresh(); |
|
62 | + $user->applicant ()->save (new Manager ()); |
|
63 | + $user->refresh (); |
|
64 | 64 | } |
65 | 65 | $user->manager->department_id = $department_id; |
66 | - $user->manager->save(); |
|
66 | + $user->manager->save (); |
|
67 | 67 | |
68 | - $user->refresh(); |
|
69 | - $expectedUrl = session()->remove('url.expected'); |
|
70 | - session()->remove('url.expected'); |
|
71 | - return redirect($expectedUrl); |
|
68 | + $user->refresh (); |
|
69 | + $expectedUrl = session ()->remove ('url.expected'); |
|
70 | + session ()->remove ('url.expected'); |
|
71 | + return redirect ($expectedUrl); |
|
72 | 72 | } |
73 | 73 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | protected function redirectTo() |
33 | 33 | { |
34 | - $redirectTo = WhichPortal::isManagerPortal() ? route('manager.home') : route('home'); |
|
34 | + $redirectTo = WhichPortal::isManagerPortal () ? route('manager.home') : route ('home'); |
|
35 | 35 | return $redirectTo; |
36 | 36 | } |
37 | 37 | |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function __construct() |
44 | 44 | { |
45 | - $this->middleware('guest'); |
|
45 | + $this->middleware ('guest'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | /** |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public function showResetForm(Request $request, $token = null) |
58 | 58 | { |
59 | - return view('auth.passwords.reset')->with([ |
|
59 | + return view ('auth.passwords.reset')->with ([ |
|
60 | 60 | 'token' => $token, |
61 | 61 | 'email' => $request->email, |
62 | - 'routes' => $this->auth_routes(), |
|
63 | - 'reset_password' => Lang::get('common/auth/reset_password'), |
|
62 | + 'routes' => $this->auth_routes (), |
|
63 | + 'reset_password' => Lang::get ('common/auth/reset_password'), |
|
64 | 64 | ]); |
65 | 65 | } |
66 | 66 |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | protected function redirectTo() |
39 | 39 | { |
40 | - $redirectTo = WhichPortal::isManagerPortal() ? route('manager.home') : route('home'); |
|
40 | + $redirectTo = WhichPortal::isManagerPortal () ? route('manager.home') : route ('home'); |
|
41 | 41 | return $redirectTo; |
42 | 42 | } |
43 | 43 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function __construct() |
50 | 50 | { |
51 | - $this->middleware('guest'); |
|
51 | + $this->middleware ('guest'); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
@@ -58,10 +58,10 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function showRegistrationForm() |
60 | 60 | { |
61 | - return view('auth.register', [ |
|
62 | - 'routes' => $this->auth_routes(), |
|
63 | - 'register' => Lang::get('common/auth/register'), |
|
64 | - 'home_url' => route('home'), |
|
61 | + return view ('auth.register', [ |
|
62 | + 'routes' => $this->auth_routes (), |
|
63 | + 'register' => Lang::get ('common/auth/register'), |
|
64 | + 'home_url' => route ('home'), |
|
65 | 65 | ]); |
66 | 66 | } |
67 | 67 | |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function showManagerRegistrationForm() |
74 | 74 | { |
75 | - return view('auth.register_manager', [ |
|
76 | - 'routes' => $this->auth_routes(), |
|
77 | - 'register' => Lang::get('common/auth/register'), |
|
78 | - 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get('common/auth/register.not_in_gov')], |
|
79 | - 'departments' => Department::all(), |
|
80 | - 'home_url' => route('manager.home'), |
|
75 | + return view ('auth.register_manager', [ |
|
76 | + 'routes' => $this->auth_routes (), |
|
77 | + 'register' => Lang::get ('common/auth/register'), |
|
78 | + 'not_in_gov_option' => ['value' => 0, 'name' => Lang::get ('common/auth/register.not_in_gov')], |
|
79 | + 'departments' => Department::all (), |
|
80 | + 'home_url' => route ('manager.home'), |
|
81 | 81 | ]); |
82 | 82 | } |
83 | 83 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | */ |
91 | 91 | protected function validator(array $data) |
92 | 92 | { |
93 | - return RegistrationValidator::userValidator($data); |
|
93 | + return RegistrationValidator::userValidator ($data); |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | protected function managerValidator(array $data) |
103 | 103 | { |
104 | - return RegistrationValidator::managerValidator($data); |
|
104 | + return RegistrationValidator::managerValidator ($data); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -112,20 +112,20 @@ discard block |
||
112 | 112 | */ |
113 | 113 | protected function create(array $data) |
114 | 114 | { |
115 | - $user = new User(); |
|
115 | + $user = new User (); |
|
116 | 116 | $user->first_name = $data['first_name']; |
117 | 117 | $user->last_name = $data['last_name']; |
118 | 118 | $user->email = $data['email']; |
119 | - $user->password = Hash::make($data['password']); |
|
119 | + $user->password = Hash::make ($data['password']); |
|
120 | 120 | |
121 | 121 | // Default to basic user. |
122 | - $user->setRole('basic'); |
|
122 | + $user->setRole ('basic'); |
|
123 | 123 | |
124 | - $user->save(); |
|
124 | + $user->save (); |
|
125 | 125 | |
126 | - $user->applicant()->save(new Applicant()); |
|
126 | + $user->applicant ()->save (new Applicant ()); |
|
127 | 127 | |
128 | - return $user->fresh(); |
|
128 | + return $user->fresh (); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -137,28 +137,28 @@ discard block |
||
137 | 137 | protected function createManager(array $data) |
138 | 138 | { |
139 | 139 | // Create basic user. |
140 | - $user = $this->create($data); |
|
140 | + $user = $this->create ($data); |
|
141 | 141 | |
142 | 142 | // Save manager specific fields. |
143 | - $managerDepartment = Department::find($data['department']); |
|
143 | + $managerDepartment = Department::find ($data['department']); |
|
144 | 144 | $inGovernment = ($managerDepartment !== null); |
145 | 145 | $user->not_in_gov = !$inGovernment; |
146 | 146 | $user->gov_email = $inGovernment ? $data['gov_email'] : null; |
147 | - $user->save(); |
|
148 | - $user->refresh(); |
|
147 | + $user->save (); |
|
148 | + $user->refresh (); |
|
149 | 149 | |
150 | 150 | // Add (or update) manager profile. |
151 | 151 | // NOTE: modifying a field in $user, and saving it, appears to create Manager object. I don't know how. -- Tristan |
152 | 152 | // That means that after setting not_in_gov or gov_email, a manager already exists here. Adding a new one will throw an exception. |
153 | 153 | $department_id = $inGovernment ? $managerDepartment->id : null; |
154 | 154 | if ($user->manager === null) { |
155 | - $user->applicant()->save(new Manager()); |
|
156 | - $user->refresh(); |
|
155 | + $user->applicant ()->save (new Manager ()); |
|
156 | + $user->refresh (); |
|
157 | 157 | } |
158 | 158 | $user->manager->department_id = $department_id; |
159 | - $user->manager->save(); |
|
159 | + $user->manager->save (); |
|
160 | 160 | |
161 | - return $user->fresh(); |
|
161 | + return $user->fresh (); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | protected function registered(Request $request, $user) |
173 | 173 | { |
174 | - return redirect()->intended($this->redirectTo()); |
|
174 | + return redirect ()->intended ($this->redirectTo ()); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | /** |
@@ -183,13 +183,13 @@ discard block |
||
183 | 183 | */ |
184 | 184 | public function registerManager(Request $request) |
185 | 185 | { |
186 | - $this->managerValidator($request->all())->validate(); |
|
186 | + $this->managerValidator ($request->all ())->validate (); |
|
187 | 187 | |
188 | - event(new Registered($user = $this->createManager($request->all()))); |
|
188 | + event (new Registered ($user = $this->createManager ($request->all ()))); |
|
189 | 189 | |
190 | - $this->guard()->login($user); |
|
190 | + $this->guard ()->login ($user); |
|
191 | 191 | |
192 | - return $this->registered($request, $user) |
|
193 | - ?: redirect($this->redirectPath()); |
|
192 | + return $this->registered ($request, $user) |
|
193 | + ?: redirect ($this->redirectPath ()); |
|
194 | 194 | } |
195 | 195 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | */ |
29 | 29 | public function __construct() |
30 | 30 | { |
31 | - $this->middleware('guest'); |
|
31 | + $this->middleware ('guest'); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | */ |
41 | 41 | public function showLinkRequestForm() |
42 | 42 | { |
43 | - return view('auth.passwords.email', [ |
|
44 | - 'routes' => $this->auth_routes(), |
|
45 | - 'forgot_password' => Lang::get('common/auth/forgot_password'), |
|
43 | + return view ('auth.passwords.email', [ |
|
44 | + 'routes' => $this->auth_routes (), |
|
45 | + 'forgot_password' => Lang::get ('common/auth/forgot_password'), |
|
46 | 46 | ]); |
47 | 47 | } |
48 | 48 | } |
@@ -19,13 +19,13 @@ discard block |
||
19 | 19 | { |
20 | 20 | // Authorization handled by the FormRequest. |
21 | 21 | // Data validation handled by this line. |
22 | - $data = $request->validated(); |
|
23 | - $ratingGuideAnswer = new RatingGuideAnswer($data); |
|
24 | - $ratingGuideAnswer->save(); |
|
22 | + $data = $request->validated (); |
|
23 | + $ratingGuideAnswer = new RatingGuideAnswer ($data); |
|
24 | + $ratingGuideAnswer->save (); |
|
25 | 25 | |
26 | 26 | return [ |
27 | 27 | 'success' => "Successfully created rating guide answer $ratingGuideAnswer->id", |
28 | - 'rating_guide_answer' => $ratingGuideAnswer->toArray(), |
|
28 | + 'rating_guide_answer' => $ratingGuideAnswer->toArray (), |
|
29 | 29 | ]; |
30 | 30 | } |
31 | 31 | |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function show(RatingGuideAnswer $ratingGuideAnswer) |
39 | 39 | { |
40 | - $this->authorize('view', $ratingGuideAnswer); |
|
41 | - return $ratingGuideAnswer->toArray(); |
|
40 | + $this->authorize ('view', $ratingGuideAnswer); |
|
41 | + return $ratingGuideAnswer->toArray (); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | /** |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | { |
54 | 54 | // Authorization handled by the FormRequest. |
55 | 55 | // Data validation handled by this line. |
56 | - $data = $request->validated(); |
|
56 | + $data = $request->validated (); |
|
57 | 57 | |
58 | - $ratingGuideAnswer->fill($data); |
|
59 | - $ratingGuideAnswer->save(); |
|
60 | - $ratingGuideAnswer->refresh(); |
|
58 | + $ratingGuideAnswer->fill ($data); |
|
59 | + $ratingGuideAnswer->save (); |
|
60 | + $ratingGuideAnswer->refresh (); |
|
61 | 61 | return [ |
62 | 62 | 'success' => "Successfully updated rating guide answer $ratingGuideAnswer->id", |
63 | - 'rating_guide_answer' => $ratingGuideAnswer->toArray(), |
|
63 | + 'rating_guide_answer' => $ratingGuideAnswer->toArray (), |
|
64 | 64 | ]; |
65 | 65 | } |
66 | 66 | |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function destroy(RatingGuideAnswer $ratingGuideAnswer) |
74 | 74 | { |
75 | - $this->authorize('delete', $ratingGuideAnswer); |
|
76 | - $ratingGuideAnswer->delete(); |
|
75 | + $this->authorize ('delete', $ratingGuideAnswer); |
|
76 | + $ratingGuideAnswer->delete (); |
|
77 | 77 | |
78 | 78 | return [ |
79 | 79 | 'success' => "Successfully deleted rating guide answer $ratingGuideAnswer->id" |