@@ -17,6 +17,6 @@ |
||
17 | 17 | app(InviteUser::class)->handle($user, auth()->guard('chief')->user()); |
18 | 18 | |
19 | 19 | return redirect()->route('chief.back.users.index') |
20 | - ->with('messages.success', $user->fullname . ' is opnieuw een uitnodiging verstuurd.'); |
|
20 | + ->with('messages.success', $user->fullname.' is opnieuw een uitnodiging verstuurd.'); |
|
21 | 21 | } |
22 | 22 | } |
@@ -25,7 +25,7 @@ |
||
25 | 25 | $this->validate($request, [ |
26 | 26 | 'firstname' => 'required|max:50', |
27 | 27 | 'lastname' => 'required|max:50', |
28 | - 'email' => 'required|email|unique:' . (new User())->getTable() . ',email,' . $user->id, |
|
28 | + 'email' => 'required|email|unique:'.(new User())->getTable().',email,'.$user->id, |
|
29 | 29 | ]); |
30 | 30 | |
31 | 31 | $user->update($request->only(['firstname', 'lastname', 'email'])); |
@@ -20,11 +20,11 @@ |
||
20 | 20 | return redirect('/'); |
21 | 21 | } |
22 | 22 | |
23 | - if (! $request->user('chief')->hasRole($role)) { |
|
23 | + if (!$request->user('chief')->hasRole($role)) { |
|
24 | 24 | abort(403); |
25 | 25 | } |
26 | 26 | |
27 | - if (! $request->user('chief')->can($permission)) { |
|
27 | + if (!$request->user('chief')->can($permission)) { |
|
28 | 28 | abort(403); |
29 | 29 | } |
30 | 30 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | public function handle($request, Closure $next) |
19 | 19 | { |
20 | - if (! $request->user('chief') || ! $request->session()) { |
|
20 | + if (!$request->user('chief') || !$request->session()) { |
|
21 | 21 | return $next($request); |
22 | 22 | } |
23 | 23 | |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | } |
30 | 30 | } |
31 | 31 | |
32 | - if (! $request->session()->has('chief_password_hash')) { |
|
32 | + if (!$request->session()->has('chief_password_hash')) { |
|
33 | 33 | $this->storePasswordHashInSession($request); |
34 | 34 | } |
35 | 35 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | $this->logout($request); |
38 | 38 | } |
39 | 39 | |
40 | - return tap($next($request), function () use ($request) { |
|
40 | + return tap($next($request), function() use ($request) { |
|
41 | 41 | $this->storePasswordHashInSession($request); |
42 | 42 | }); |
43 | 43 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function storePasswordHashInSession($request) |
52 | 52 | { |
53 | - if (! $request->user('chief')) { |
|
53 | + if (!$request->user('chief')) { |
|
54 | 54 | return; |
55 | 55 | } |
56 | 56 |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $adminRoute = config('chief.route.prefix', '/admin'); |
21 | 21 | |
22 | 22 | // Add exception routes for all chief admin endpoints. |
23 | - $this->except[] = rtrim($adminRoute, '/') . '/*'; |
|
23 | + $this->except[] = rtrim($adminRoute, '/').'/*'; |
|
24 | 24 | |
25 | 25 | return parent::handle($request, $next); |
26 | 26 | } |
@@ -38,10 +38,10 @@ |
||
38 | 38 | { |
39 | 39 | // Low level way to only allow TT users |
40 | 40 | // this is not a safe way to handle security and is only used for convenience, not to secure page restriction!! |
41 | - if (! $this->auth->user() || ! $this->authorize('update-squanto')) { |
|
41 | + if (!$this->auth->user() || !$this->authorize('update-squanto')) { |
|
42 | 42 | if ($request->ajax()) { |
43 | 43 | return response('Unauthorized.', 401); |
44 | - } else { |
|
44 | + }else { |
|
45 | 45 | return redirect()->guest('admin/login'); |
46 | 46 | } |
47 | 47 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | return redirect('/'); |
21 | 21 | } |
22 | 22 | |
23 | - if (! $request->user('chief')->can($permission)) { |
|
23 | + if (!$request->user('chief')->can($permission)) { |
|
24 | 24 | abort(403); |
25 | 25 | } |
26 | 26 |
@@ -18,18 +18,18 @@ |
||
18 | 18 | public function handle($request, Closure $next) |
19 | 19 | { |
20 | 20 | // Verifies a valid signature and still outside expiration period |
21 | - if (! $request->hasValidSignature()) { |
|
21 | + if (!$request->hasValidSignature()) { |
|
22 | 22 | return redirect()->route('invite.expired'); |
23 | 23 | } |
24 | 24 | |
25 | - if (! $invitation = Invitation::findByToken($request->token)) { |
|
25 | + if (!$invitation = Invitation::findByToken($request->token)) { |
|
26 | 26 | return redirect()->route('invite.expired'); |
27 | 27 | } |
28 | 28 | |
29 | 29 | if (in_array($invitation->stateOf(InvitationState::KEY), [InvitationState::ACCEPTED, InvitationState::REVOKED])) { |
30 | 30 | |
31 | 31 | // We allow the user to pass if the invitee is already logged in. Otherwise the invite link cannot be reused. |
32 | - if (! auth()->guard('chief')->check() || ! auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
32 | + if (!auth()->guard('chief')->check() || !auth()->guard('chief')->user()->is($invitation->invitee)) { |
|
33 | 33 | return redirect()->route('invite.expired'); |
34 | 34 | } |
35 | 35 | } |
@@ -82,7 +82,7 @@ |
||
82 | 82 | protected function unauthorized(\Illuminate\Http\Request $request, AuthorizationException $exception) |
83 | 83 | { |
84 | 84 | return redirect()->route('chief.back.dashboard') |
85 | - ->with('messages.error', 'Oeps. Het lijkt erop dat je geen toegang hebt tot dit deel van chief. Vraag even de beheerder voor meer info.'); |
|
85 | + ->with('messages.error', 'Oeps. Het lijkt erop dat je geen toegang hebt tot dit deel van chief. Vraag even de beheerder voor meer info.'); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | |
63 | 63 | private function shouldRenderChiefException(Throwable $exception): bool |
64 | 64 | { |
65 | - return (Str::startsWith(request()->path(), 'admin/') && ! $exception instanceof AuthenticationException && ! $exception instanceof ValidationException); |
|
65 | + return (Str::startsWith(request()->path(), 'admin/') && !$exception instanceof AuthenticationException && !$exception instanceof ValidationException); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | protected function renderChiefException(\Illuminate\Http\Request $request, Throwable $exception) |
69 | 69 | { |
70 | - if (! config('app.debug')) { |
|
70 | + if (!config('app.debug')) { |
|
71 | 71 | if ($request->expectsJson()) { |
72 | 72 | return response()->json(['error' => 'Something went wrong.'], 404); |
73 | 73 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | return response()->json(['error' => 'Unauthenticated.'], 401); |
99 | 99 | } |
100 | 100 | |
101 | - if (! empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
101 | + if (!empty($exception->guards()) && Arr::first($exception->guards()) == 'chief') { |
|
102 | 102 | return redirect()->guest(route('chief.back.login')); |
103 | 103 | } |
104 | 104 |