@@ -44,10 +44,10 @@ discard block |
||
44 | 44 | public function pluck(string $key): array |
45 | 45 | { |
46 | 46 | return Collection::make($this->modules()) |
47 | - ->filter(function ($module) use ($key) { |
|
47 | + ->filter(function($module) use ($key) { |
|
48 | 48 | return isset($module[$key]); |
49 | 49 | }) |
50 | - ->mapWithKeys(function ($module, $name) use ($key) { |
|
50 | + ->mapWithKeys(function($module, $name) use ($key) { |
|
51 | 51 | return [$name => $module[$key]]; |
52 | 52 | }) |
53 | 53 | ->toArray(); |
@@ -71,13 +71,13 @@ discard block |
||
71 | 71 | |
72 | 72 | $this->write( |
73 | 73 | Collection::make($packages) |
74 | - ->mapWithKeys(function ($package) { |
|
74 | + ->mapWithKeys(function($package) { |
|
75 | 75 | return [$this->format($package['name']) => $package['extra']['arcanesoft'] ?? []]; |
76 | 76 | }) |
77 | - ->each(function ($configuration) use (&$ignore) { |
|
77 | + ->each(function($configuration) use (&$ignore) { |
|
78 | 78 | $ignore = array_merge($ignore, $configuration['dont-discover'] ?? []); |
79 | 79 | }) |
80 | - ->reject(function ($configuration, $package) use ($ignore, $ignoreAll) { |
|
80 | + ->reject(function($configuration, $package) use ($ignore, $ignoreAll) { |
|
81 | 81 | return $ignoreAll || in_array($package, $ignore); |
82 | 82 | }) |
83 | 83 | ->filter() |
@@ -41,13 +41,15 @@ discard block |
||
41 | 41 | */ |
42 | 42 | protected function form(string $view, Request $request = null) |
43 | 43 | { |
44 | - if (is_null($request)) |
|
45 | - $request = request(); |
|
44 | + if (is_null($request)) { |
|
45 | + $request = request(); |
|
46 | + } |
|
46 | 47 | |
47 | - if (is_null($request->session()->get('login.id'))) |
|
48 | - return redirect()->to( |
|
48 | + if (is_null($request->session()->get('login.id'))) { |
|
49 | + return redirect()->to( |
|
49 | 50 | $this->getFailedTwoFactorRedirectUrl($request) |
50 | 51 | ); |
52 | + } |
|
51 | 53 | |
52 | 54 | $request->session()->reflash(); |
53 | 55 | |
@@ -72,8 +74,7 @@ discard block |
||
72 | 74 | if ($code = $request->validRecoveryCode()) { |
73 | 75 | $this->getTwoFactorAuthenticationRepository() |
74 | 76 | ->replaceRecoveryCode($user, $code); |
75 | - } |
|
76 | - elseif ( ! $request->hasValidCode()) { |
|
77 | + } elseif ( ! $request->hasValidCode()) { |
|
77 | 78 | return $this->getFailedTwoFactorLoginResponse($request); |
78 | 79 | } |
79 | 80 | |
@@ -92,8 +93,9 @@ discard block |
||
92 | 93 | */ |
93 | 94 | protected function getTwoFactorLoginResponse(Request $request, $user) |
94 | 95 | { |
95 | - if ($request->wantsJson()) |
|
96 | - return new JsonResponse('', JsonResponse::HTTP_NO_CONTENT); |
|
96 | + if ($request->wantsJson()) { |
|
97 | + return new JsonResponse('', JsonResponse::HTTP_NO_CONTENT); |
|
98 | + } |
|
97 | 99 | |
98 | 100 | return redirect()->to($this->getRedirectUrlAfterLogin($request, $user)); |
99 | 101 | } |
@@ -92,8 +92,9 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function shouldUseTwoFactor($user): bool |
94 | 94 | { |
95 | - if ( ! Auth::isTwoFactorEnabled()) |
|
96 | - return false; |
|
95 | + if ( ! Auth::isTwoFactorEnabled()) { |
|
96 | + return false; |
|
97 | + } |
|
97 | 98 | |
98 | 99 | return optional($user)->isTwoFactorEnabled() |
99 | 100 | && in_array(HasTwoFactorAuthentication::class, class_uses_recursive($user)); |
@@ -134,8 +135,9 @@ discard block |
||
134 | 135 | 'login.remember' => $request->filled('remember') |
135 | 136 | ]); |
136 | 137 | |
137 | - if ($request->wantsJson()) |
|
138 | - return new JsonResponse(['two_factor' => true]); |
|
138 | + if ($request->wantsJson()) { |
|
139 | + return new JsonResponse(['two_factor' => true]); |
|
140 | + } |
|
139 | 141 | |
140 | 142 | return redirect()->to($this->getTwoFactorUrl($request)); |
141 | 143 | } |
@@ -67,8 +67,9 @@ discard block |
||
67 | 67 | $saved = $twoFactor->save(); |
68 | 68 | event(new EnabledTwoFactor($user)); |
69 | 69 | |
70 | - if ($saved) |
|
71 | - $user->refresh(); |
|
70 | + if ($saved) { |
|
71 | + $user->refresh(); |
|
72 | + } |
|
72 | 73 | |
73 | 74 | return $saved; |
74 | 75 | } |
@@ -88,8 +89,9 @@ discard block |
||
88 | 89 | $deleted = $twoFactor->delete(); |
89 | 90 | event(new EnablingTwoFactor($user)); |
90 | 91 | |
91 | - if ($deleted) |
|
92 | - $user->refresh(); |
|
92 | + if ($deleted) { |
|
93 | + $user->refresh(); |
|
94 | + } |
|
93 | 95 | |
94 | 96 | return $deleted; |
95 | 97 | } |
@@ -81,8 +81,9 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function hasValidCode(): bool |
83 | 83 | { |
84 | - if (is_null($this->code)) |
|
85 | - return false; |
|
84 | + if (is_null($this->code)) { |
|
85 | + return false; |
|
86 | + } |
|
86 | 87 | |
87 | 88 | $secret = $this->twoFactor()->decrypted_secret; |
88 | 89 | |
@@ -110,16 +111,19 @@ discard block |
||
110 | 111 | */ |
111 | 112 | public function challengedUser(): ?HasTwoFactor |
112 | 113 | { |
113 | - if ($this->challengedUser) |
|
114 | - return $this->challengedUser; |
|
114 | + if ($this->challengedUser) { |
|
115 | + return $this->challengedUser; |
|
116 | + } |
|
115 | 117 | |
116 | 118 | $model = $this->guard()->getProvider()->getModel(); |
117 | 119 | |
118 | - if ( ! $this->session()->has('login.id')) |
|
119 | - return null; |
|
120 | + if ( ! $this->session()->has('login.id')) { |
|
121 | + return null; |
|
122 | + } |
|
120 | 123 | |
121 | - if ( ! $user = $model::find($this->session()->pull('login.id'))) |
|
122 | - return null; |
|
124 | + if ( ! $user = $model::find($this->session()->pull('login.id'))) { |
|
125 | + return null; |
|
126 | + } |
|
123 | 127 | |
124 | 128 | return $this->challengedUser = $user; |
125 | 129 | } |
@@ -39,8 +39,9 @@ |
||
39 | 39 | { |
40 | 40 | $confirmed = $this->confirmCredentials($request); |
41 | 41 | |
42 | - if ( ! $confirmed) |
|
43 | - return $this->getFailedResponse($request); |
|
42 | + if ( ! $confirmed) { |
|
43 | + return $this->getFailedResponse($request); |
|
44 | + } |
|
44 | 45 | |
45 | 46 | $request->session()->put($this->sessionKey(), time()); |
46 | 47 |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $value = null, |
59 | 59 | ?string $label = null, |
60 | 60 | bool $grouped = false |
61 | - ){ |
|
61 | + ) { |
|
62 | 62 | |
63 | 63 | $this->options = $options; |
64 | 64 | $this->name = $name; |
@@ -36,17 +36,17 @@ |
||
36 | 36 | $this->prefix('email/verification')->name('email.verification.')->middleware(['auth'])->group(function () { |
37 | 37 | // auth::email.verification.notice |
38 | 38 | $this->get('/', [EmailVerificationController::class, 'show']) |
39 | - ->name('notice'); |
|
39 | + ->name('notice'); |
|
40 | 40 | |
41 | 41 | // auth::email.verification.resend |
42 | 42 | $this->post('/', [EmailVerificationController::class, 'resend']) |
43 | - ->middleware(['throttle:6,1']) // TODO: Make the throttle configurable |
|
44 | - ->name('resend'); |
|
43 | + ->middleware(['throttle:6,1']) // TODO: Make the throttle configurable |
|
44 | + ->name('resend'); |
|
45 | 45 | |
46 | 46 | // auth::email.verification.verify |
47 | 47 | $this->get('{id}/{hash}', [EmailVerificationController::class, 'verify']) |
48 | - ->middleware(['signed', 'throttle:6,1']) // TODO: Make the throttle configurable |
|
49 | - ->name('verify'); |
|
48 | + ->middleware(['signed', 'throttle:6,1']) // TODO: Make the throttle configurable |
|
49 | + ->name('verify'); |
|
50 | 50 | }); |
51 | 51 | } |
52 | 52 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function map(): void |
35 | 35 | { |
36 | - $this->prefix('email/verification')->name('email.verification.')->middleware(['auth'])->group(function () { |
|
36 | + $this->prefix('email/verification')->name('email.verification.')->middleware(['auth'])->group(function() { |
|
37 | 37 | // auth::email.verification.notice |
38 | 38 | $this->get('/', [EmailVerificationController::class, 'show']) |
39 | 39 | ->name('notice'); |
@@ -34,62 +34,62 @@ |
||
34 | 34 | $this->name('users.')->prefix('users')->group(function () { |
35 | 35 | // admin::authorization.users.index |
36 | 36 | $this->get('/', [UsersController::class, 'index']) |
37 | - ->name('index'); |
|
37 | + ->name('index'); |
|
38 | 38 | |
39 | 39 | // admin::authorization.users.datatable |
40 | 40 | $this->post('datatable', [UsersController::class, 'datatable']) |
41 | - ->middleware(['ajax']) |
|
42 | - ->name('datatable'); |
|
41 | + ->middleware(['ajax']) |
|
42 | + ->name('datatable'); |
|
43 | 43 | |
44 | 44 | // admin::authorization.users.metrics |
45 | 45 | $this->get('metrics', [UsersController::class, 'metrics']) |
46 | - ->name('metrics'); |
|
46 | + ->name('metrics'); |
|
47 | 47 | |
48 | 48 | // admin::authorization.users.create |
49 | 49 | $this->get('create', [UsersController::class, 'create']) |
50 | - ->name('create'); |
|
50 | + ->name('create'); |
|
51 | 51 | |
52 | 52 | // admin::authorization.users.post |
53 | 53 | $this->post('store', [UsersController::class, 'store']) |
54 | - ->name('store'); |
|
54 | + ->name('store'); |
|
55 | 55 | |
56 | 56 | $this->prefix('{'.static::USER_WILDCARD.'}')->group(function () { |
57 | 57 | // admin::authorization.users.show |
58 | 58 | $this->get('/', [UsersController::class, 'show']) |
59 | - ->name('show'); |
|
59 | + ->name('show'); |
|
60 | 60 | |
61 | 61 | // admin::authorization.users.edit |
62 | 62 | $this->get('edit', [UsersController::class, 'edit']) |
63 | - ->name('edit'); |
|
63 | + ->name('edit'); |
|
64 | 64 | |
65 | 65 | // admin::authorization.users.update |
66 | 66 | $this->put('update', [UsersController::class, 'update']) |
67 | - ->name('update'); |
|
67 | + ->name('update'); |
|
68 | 68 | |
69 | 69 | // admin::authorization.users.activate |
70 | 70 | $this->put('activate', [UsersController::class, 'activate']) |
71 | - ->middleware(['ajax']) |
|
72 | - ->name('activate'); |
|
71 | + ->middleware(['ajax']) |
|
72 | + ->name('activate'); |
|
73 | 73 | |
74 | 74 | // admin::authorization.users.deactivate |
75 | 75 | $this->put('deactivate', [UsersController::class, 'deactivate']) |
76 | - ->middleware(['ajax']) |
|
77 | - ->name('deactivate'); |
|
76 | + ->middleware(['ajax']) |
|
77 | + ->name('deactivate'); |
|
78 | 78 | |
79 | 79 | // admin::authorization.users.delete |
80 | 80 | $this->delete('delete', [UsersController::class, 'delete']) |
81 | - ->middleware(['ajax']) |
|
82 | - ->name('delete'); |
|
81 | + ->middleware(['ajax']) |
|
82 | + ->name('delete'); |
|
83 | 83 | |
84 | 84 | // admin::authorization.users.restore |
85 | 85 | $this->put('restore', [UsersController::class, 'restore']) |
86 | - ->middleware(['ajax']) |
|
87 | - ->name('restore'); |
|
86 | + ->middleware(['ajax']) |
|
87 | + ->name('restore'); |
|
88 | 88 | |
89 | 89 | if (impersonator()->isEnabled()) { |
90 | 90 | // admin::authorization.users.impersonate |
91 | 91 | $this->get('impersonate', [UsersController::class, 'impersonate']) |
92 | - ->name('impersonate'); |
|
92 | + ->name('impersonate'); |
|
93 | 93 | } |
94 | 94 | }); |
95 | 95 | }); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function map(): void |
33 | 33 | { |
34 | - $this->name('users.')->prefix('users')->group(function () { |
|
34 | + $this->name('users.')->prefix('users')->group(function() { |
|
35 | 35 | // admin::authorization.users.index |
36 | 36 | $this->get('/', [UsersController::class, 'index']) |
37 | 37 | ->name('index'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->post('store', [UsersController::class, 'store']) |
54 | 54 | ->name('store'); |
55 | 55 | |
56 | - $this->prefix('{'.static::USER_WILDCARD.'}')->group(function () { |
|
56 | + $this->prefix('{'.static::USER_WILDCARD.'}')->group(function() { |
|
57 | 57 | // admin::authorization.users.show |
58 | 58 | $this->get('/', [UsersController::class, 'show']) |
59 | 59 | ->name('show'); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public function bindings(UsersRepository $repo): void |
104 | 104 | { |
105 | - $this->bind(static::USER_WILDCARD, function (string $uuid) use ($repo) { |
|
105 | + $this->bind(static::USER_WILDCARD, function(string $uuid) use ($repo) { |
|
106 | 106 | return $repo->firstWhereUuidOrFail($uuid); |
107 | 107 | }); |
108 | 108 | } |