@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function onlyTrashed(bool $condition = true) |
78 | 78 | { |
79 | - return $this->when($condition, function (Builder $q) { |
|
79 | + return $this->when($condition, function(Builder $q) { |
|
80 | 80 | return $q->onlyTrashed(); |
81 | 81 | }); |
82 | 82 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | $attributes['password'] = $attributes['password'] ?? Str::random(8); |
114 | 114 | |
115 | - return tap($this->model()->fill($attributes), function (Administrator $administrator) use ($attributes) { |
|
115 | + return tap($this->model()->fill($attributes), function(Administrator $administrator) use ($attributes) { |
|
116 | 116 | $administrator->forceFill([ |
117 | 117 | 'activated_at' => $attributes['activated_at'] ?? now(), // TODO: Add a setting to change this |
118 | 118 | ]); |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | { |
133 | 133 | $roles = $attributes['roles']; |
134 | 134 | |
135 | - return tap($this->createOne($attributes), function ($administrator) use ($roles) { |
|
135 | + return tap($this->createOne($attributes), function($administrator) use ($roles) { |
|
136 | 136 | $this->syncRolesByUuids($administrator, $roles); |
137 | 137 | }); |
138 | 138 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | { |
166 | 166 | $roles = $attributes['roles']; |
167 | 167 | |
168 | - return tap($this->updateOne($administrator, $attributes), function () use ($administrator, $roles) { |
|
168 | + return tap($this->updateOne($administrator, $attributes), function() use ($administrator, $roles) { |
|
169 | 169 | $this->syncRolesByUuids($administrator, $roles); |
170 | 170 | }); |
171 | 171 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | return ! Auth::makeModel('role') |
63 | 63 | ->newQuery() |
64 | 64 | ->where('key', Auth::slugRoleKey($value)) |
65 | - ->unless(is_null($this->ignored), function (Builder $query) { |
|
65 | + ->unless(is_null($this->ignored), function(Builder $query) { |
|
66 | 66 | return $query->where('id', '!=', $this->ignored); |
67 | 67 | }) |
68 | 68 | ->exists(); |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | { |
33 | 33 | $providers = Auth::config('authentication.socialite.providers', []); |
34 | 34 | |
35 | - return Collection::make($providers)->transform(function (array $provider, string $key) { |
|
35 | + return Collection::make($providers)->transform(function(array $provider, string $key) { |
|
36 | 36 | return new SocialiteProvider(array_merge($provider, ['type' => $key])); |
37 | 37 | }); |
38 | 38 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public static function getEnabledProviders(): Collection |
46 | 46 | { |
47 | - return static::getProviders()->filter(function (SocialiteProvider $provider) { |
|
47 | + return static::getProviders()->filter(function(SocialiteProvider $provider) { |
|
48 | 48 | return $provider->enabled ?? false; |
49 | 49 | }); |
50 | 50 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | { |
61 | 61 | $options = config("services.{$provider}", []); |
62 | 62 | |
63 | - return tap(static::driver($provider), function (Provider $socialite) use ($provider, $options) { |
|
63 | + return tap(static::driver($provider), function(Provider $socialite) use ($provider, $options) { |
|
64 | 64 | $scopes = $options['scopes'] ?? []; |
65 | 65 | $with = $options['with'] ?? []; |
66 | 66 | $fields = $options['fields'] ?? []; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function map(): void |
45 | 45 | { |
46 | - $this->adminGroup(function () { |
|
46 | + $this->adminGroup(function() { |
|
47 | 47 | static::mapRouteClasses($this->getRouteClasses()); |
48 | 48 | }); |
49 | 49 | } |
@@ -23,20 +23,20 @@ |
||
23 | 23 | */ |
24 | 24 | public function map(): void |
25 | 25 | { |
26 | - $this->prefix('profile')->name('profile.')->middleware(['administrator.password.confirm'])->group(function () { |
|
26 | + $this->prefix('profile')->name('profile.')->middleware(['administrator.password.confirm'])->group(function() { |
|
27 | 27 | // admin::auth.profile.index |
28 | 28 | $this->get('/', [ProfileController::class, 'index']) |
29 | 29 | ->name('index'); |
30 | 30 | |
31 | 31 | // Account |
32 | - $this->prefix('account')->name('account.')->group(function () { |
|
32 | + $this->prefix('account')->name('account.')->group(function() { |
|
33 | 33 | // admin::auth.profile.account.update |
34 | 34 | $this->put('update', [ProfileController::class, 'updateAccount']) |
35 | 35 | ->name('update'); |
36 | 36 | }); |
37 | 37 | |
38 | 38 | // Password |
39 | - $this->prefix('password')->name('password.')->group(function () { |
|
39 | + $this->prefix('password')->name('password.')->group(function() { |
|
40 | 40 | // admin::auth.profile.password.update |
41 | 41 | $this->put('update', [ProfileController::class, 'updatePassword']) |
42 | 42 | ->name('update'); |
@@ -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 |
@@ -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 |
@@ -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'); |