@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->prefix('{'.static::USER_WILDCARD.'}')->group(function () { |
38 | 38 | // admin::auth.roles.administrators.detach |
39 | 39 | $this->delete('detach', [AdministratorsController::class, 'detach']) |
40 | - ->name('detach'); |
|
40 | + ->name('detach'); |
|
41 | 41 | }); |
42 | 42 | }); |
43 | 43 | } |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function map(): void |
35 | 35 | { |
36 | - $this->prefix('administrators')->name('administrators.')->group(function () { |
|
37 | - $this->prefix('{'.static::USER_WILDCARD.'}')->group(function () { |
|
36 | + $this->prefix('administrators')->name('administrators.')->group(function() { |
|
37 | + $this->prefix('{'.static::USER_WILDCARD.'}')->group(function() { |
|
38 | 38 | // admin::auth.roles.administrators.detach |
39 | 39 | $this->delete('detach', [AdministratorsController::class, 'detach']) |
40 | 40 | ->name('detach'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function bindings(RolesRepository $repo): void |
51 | 51 | { |
52 | - $this->bind(static::USER_WILDCARD, function (string $uuid, Route $route) use ($repo) { |
|
52 | + $this->bind(static::USER_WILDCARD, function(string $uuid, Route $route) use ($repo) { |
|
53 | 53 | /** @var \Arcanesoft\Foundation\Authorization\Models\Role $role */ |
54 | 54 | $role = $route->parameter(RolesRoutes::ROLE_WILDCARD); |
55 | 55 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->prefix('{'.static::PERMISSION_WILDCARD.'}')->group(function () { |
38 | 38 | // admin::auth.roles.permissions.detach |
39 | 39 | $this->delete('detach', [PermissionsController::class, 'detach']) |
40 | - ->name('detach'); |
|
40 | + ->name('detach'); |
|
41 | 41 | }); |
42 | 42 | }); |
43 | 43 | } |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function map(): void |
35 | 35 | { |
36 | - $this->prefix('permissions')->name('permissions.')->group(function () { |
|
37 | - $this->prefix('{'.static::PERMISSION_WILDCARD.'}')->group(function () { |
|
36 | + $this->prefix('permissions')->name('permissions.')->group(function() { |
|
37 | + $this->prefix('{'.static::PERMISSION_WILDCARD.'}')->group(function() { |
|
38 | 38 | // admin::auth.roles.permissions.detach |
39 | 39 | $this->delete('detach', [PermissionsController::class, 'detach']) |
40 | 40 | ->name('detach'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function bindings(RolesRepository $repo): void |
51 | 51 | { |
52 | - $this->bind(static::PERMISSION_WILDCARD, function (string $uuid, Route $route) use ($repo) { |
|
52 | + $this->bind(static::PERMISSION_WILDCARD, function(string $uuid, Route $route) use ($repo) { |
|
53 | 53 | /** @var \Arcanesoft\Foundation\Authorization\Models\Role $role */ |
54 | 54 | $role = $route->parameter(RolesRoutes::ROLE_WILDCARD); |
55 | 55 |
@@ -36,7 +36,7 @@ |
||
36 | 36 | $this->name('sessions.')->name('prefix')->group(function () { |
37 | 37 | $this->prefix('{'.static::WILDCARD_SESSION.'}')->group(function () { |
38 | 38 | $this->delete('delete', [SessionsController::class, 'delete']) |
39 | - ->name('delete'); // admin::auth.administrators.sessions.delete |
|
39 | + ->name('delete'); // admin::auth.administrators.sessions.delete |
|
40 | 40 | }); |
41 | 41 | }); |
42 | 42 | } |
@@ -33,8 +33,8 @@ discard block |
||
33 | 33 | */ |
34 | 34 | public function map(): void |
35 | 35 | { |
36 | - $this->name('sessions.')->name('prefix')->group(function () { |
|
37 | - $this->prefix('{'.static::WILDCARD_SESSION.'}')->group(function () { |
|
36 | + $this->name('sessions.')->name('prefix')->group(function() { |
|
37 | + $this->prefix('{'.static::WILDCARD_SESSION.'}')->group(function() { |
|
38 | 38 | $this->delete('delete', [SessionsController::class, 'delete']) |
39 | 39 | ->name('delete'); // admin::auth.administrators.sessions.delete |
40 | 40 | }); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function bindings(SessionsRepository $repo): void |
50 | 50 | { |
51 | - $this->bind(static::WILDCARD_SESSION, function (string $uuid) use ($repo) { |
|
51 | + $this->bind(static::WILDCARD_SESSION, function(string $uuid) use ($repo) { |
|
52 | 52 | return $repo->firstByIdOrFail($uuid); |
53 | 53 | }); |
54 | 54 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function map(): void |
25 | 25 | { |
26 | - $this->name('password-resets.')->prefix('password-resets')->group(function () { |
|
26 | + $this->name('password-resets.')->prefix('password-resets')->group(function() { |
|
27 | 27 | // admin::authorization.password-resets.index |
28 | 28 | $this->get('/', [PasswordResetsController::class, 'index']) |
29 | 29 | ->name('index'); |
@@ -26,16 +26,16 @@ |
||
26 | 26 | $this->name('password-resets.')->prefix('password-resets')->group(function () { |
27 | 27 | // admin::authorization.password-resets.index |
28 | 28 | $this->get('/', [PasswordResetsController::class, 'index']) |
29 | - ->name('index'); |
|
29 | + ->name('index'); |
|
30 | 30 | |
31 | 31 | // admin::authorization.password-resets.datatable |
32 | 32 | $this->post('datatable', [PasswordResetsController::class, 'datatable']) |
33 | - ->middleware(['ajax']) |
|
34 | - ->name('datatable'); |
|
33 | + ->middleware(['ajax']) |
|
34 | + ->name('datatable'); |
|
35 | 35 | |
36 | 36 | // admin::authorization.password-resets.metrics |
37 | 37 | $this->get('metrics', [PasswordResetsController::class, 'metrics']) |
38 | - ->name('metrics'); |
|
38 | + ->name('metrics'); |
|
39 | 39 | }); |
40 | 40 | } |
41 | 41 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | */ |
24 | 24 | public function map(): void |
25 | 25 | { |
26 | - $this->name('settings.')->prefix('settings')->group(function () { |
|
26 | + $this->name('settings.')->prefix('settings')->group(function() { |
|
27 | 27 | // admin::auth.settings.index |
28 | 28 | $this->get('/', [SettingsController::class, 'index']) |
29 | 29 | ->name('index'); |
@@ -31,8 +31,9 @@ |
||
31 | 31 | */ |
32 | 32 | public function handle($request, Closure $next, $guard = null) |
33 | 33 | { |
34 | - if (Auth::guard($guard)->check()) |
|
35 | - Auth::guard($guard)->user()->updateLastActivity(); |
|
34 | + if (Auth::guard($guard)->check()) { |
|
35 | + Auth::guard($guard)->user()->updateLastActivity(); |
|
36 | + } |
|
36 | 37 | |
37 | 38 | return $next($request); |
38 | 39 | } |
@@ -212,7 +212,7 @@ |
||
212 | 212 | return $payload; |
213 | 213 | } |
214 | 214 | |
215 | - return tap($payload, function (&$payload) { |
|
215 | + return tap($payload, function(&$payload) { |
|
216 | 216 | $this->addUserInformation($payload); |
217 | 217 | $this->addRequestInformation($payload); |
218 | 218 | }); |
@@ -98,8 +98,9 @@ discard block |
||
98 | 98 | { |
99 | 99 | $session = $this->findSession($sessionId); |
100 | 100 | |
101 | - if (is_null($session)) |
|
102 | - return ''; |
|
101 | + if (is_null($session)) { |
|
102 | + return ''; |
|
103 | + } |
|
103 | 104 | |
104 | 105 | if ($session->hasExpired()) { |
105 | 106 | $this->exists = true; |
@@ -148,8 +149,7 @@ discard block |
||
148 | 149 | |
149 | 150 | try { |
150 | 151 | return $this->repo->newModelInstance($attributes)->save(); |
151 | - } |
|
152 | - catch (QueryException $e) { |
|
152 | + } catch (QueryException $e) { |
|
153 | 153 | $this->performUpdate($sessionId, $attributes); |
154 | 154 | } |
155 | 155 |
@@ -72,8 +72,9 @@ discard block |
||
72 | 72 | */ |
73 | 73 | private static function getAuthProviderKey($notifiable): string |
74 | 74 | { |
75 | - if ($notifiable instanceof Administrator) |
|
76 | - return 'admins'; |
|
75 | + if ($notifiable instanceof Administrator) { |
|
76 | + return 'admins'; |
|
77 | + } |
|
77 | 78 | |
78 | 79 | return 'users'; |
79 | 80 | } |
@@ -87,8 +88,9 @@ discard block |
||
87 | 88 | */ |
88 | 89 | protected static function getPasswordResetRoute($authProviderKey): string |
89 | 90 | { |
90 | - if ($authProviderKey === 'admins') |
|
91 | - return 'admin::auth.password.reset'; |
|
91 | + if ($authProviderKey === 'admins') { |
|
92 | + return 'admin::auth.password.reset'; |
|
93 | + } |
|
92 | 94 | |
93 | 95 | return 'auth::password.reset'; |
94 | 96 | } |
@@ -71,7 +71,7 @@ |
||
71 | 71 | */ |
72 | 72 | protected static function defaultCreateUserCallback(): Closure |
73 | 73 | { |
74 | - return function (string $firstName, string $lastName, string $email, string $password) { |
|
74 | + return function(string $firstName, string $lastName, string $email, string $password) { |
|
75 | 75 | $repo = static::getAdministratorsRepository(); |
76 | 76 | |
77 | 77 | $administrator = $repo->createOne([ |