@@ -34,52 +34,52 @@ |
||
34 | 34 | $this->name('roles.')->prefix('roles')->group(function () { |
35 | 35 | // admin::authorization.roles.index |
36 | 36 | $this->get('/', [RolesController::class, 'index']) |
37 | - ->name('index'); |
|
37 | + ->name('index'); |
|
38 | 38 | |
39 | 39 | // admin::authorization.roles.datatable |
40 | 40 | $this->post('datatable', [RolesController::class, 'datatable']) |
41 | - ->middleware(['ajax']) |
|
42 | - ->name('datatable'); |
|
41 | + ->middleware(['ajax']) |
|
42 | + ->name('datatable'); |
|
43 | 43 | |
44 | 44 | // admin::authorization.roles.metrics |
45 | 45 | $this->get('metrics', [RolesController::class, 'metrics']) |
46 | - ->name('metrics'); |
|
46 | + ->name('metrics'); |
|
47 | 47 | |
48 | 48 | // admin::authorization.roles.create |
49 | 49 | $this->get('create', [RolesController::class, 'create']) |
50 | - ->name('create'); |
|
50 | + ->name('create'); |
|
51 | 51 | |
52 | 52 | // admin::authorization.roles.store |
53 | 53 | $this->post('store', [RolesController::class, 'store']) |
54 | - ->name('store'); |
|
54 | + ->name('store'); |
|
55 | 55 | |
56 | 56 | $this->prefix('{'.static::ROLE_WILDCARD.'}')->group(function () { |
57 | 57 | // admin::authorization.roles.show |
58 | 58 | $this->get('/', [RolesController::class, 'show']) |
59 | - ->name('show'); |
|
59 | + ->name('show'); |
|
60 | 60 | |
61 | 61 | // admin::authorization.roles.edit |
62 | 62 | $this->get('edit', [RolesController::class, 'edit']) |
63 | - ->name('edit'); |
|
63 | + ->name('edit'); |
|
64 | 64 | |
65 | 65 | // admin::authorization.roles.update |
66 | 66 | $this->put('update', [RolesController::class, 'update']) |
67 | - ->name('update'); |
|
67 | + ->name('update'); |
|
68 | 68 | |
69 | 69 | // admin::authorization.roles.activate |
70 | 70 | $this->put('activate', [RolesController::class, 'activate']) |
71 | - ->middleware(['ajax']) |
|
72 | - ->name('activate'); |
|
71 | + ->middleware(['ajax']) |
|
72 | + ->name('activate'); |
|
73 | 73 | |
74 | 74 | // admin::authorization.roles.deactivate |
75 | 75 | $this->put('deactivate', [RolesController::class, 'deactivate']) |
76 | - ->middleware(['ajax']) |
|
77 | - ->name('deactivate'); |
|
76 | + ->middleware(['ajax']) |
|
77 | + ->name('deactivate'); |
|
78 | 78 | |
79 | 79 | // admin::authorization.roles.delete |
80 | 80 | $this->delete('delete', [RolesController::class, 'delete']) |
81 | - ->middleware(['ajax']) |
|
82 | - ->name('delete'); |
|
81 | + ->middleware(['ajax']) |
|
82 | + ->name('delete'); |
|
83 | 83 | |
84 | 84 | $this->namespace('Roles')->group(function () { |
85 | 85 | static::mapRouteClasses([ |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function map(): void |
33 | 33 | { |
34 | - $this->name('roles.')->prefix('roles')->group(function () { |
|
34 | + $this->name('roles.')->prefix('roles')->group(function() { |
|
35 | 35 | // admin::authorization.roles.index |
36 | 36 | $this->get('/', [RolesController::class, 'index']) |
37 | 37 | ->name('index'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->post('store', [RolesController::class, 'store']) |
54 | 54 | ->name('store'); |
55 | 55 | |
56 | - $this->prefix('{'.static::ROLE_WILDCARD.'}')->group(function () { |
|
56 | + $this->prefix('{'.static::ROLE_WILDCARD.'}')->group(function() { |
|
57 | 57 | // admin::authorization.roles.show |
58 | 58 | $this->get('/', [RolesController::class, 'show']) |
59 | 59 | ->name('show'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | ->middleware(['ajax']) |
82 | 82 | ->name('delete'); |
83 | 83 | |
84 | - $this->namespace('Roles')->group(function () { |
|
84 | + $this->namespace('Roles')->group(function() { |
|
85 | 85 | static::mapRouteClasses([ |
86 | 86 | Roles\AdministratorsRoutes::class, |
87 | 87 | Roles\PermissionsRoutes::class, |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | */ |
99 | 99 | public function bindings(RolesRepository $repo): void |
100 | 100 | { |
101 | - $this->bind(static::ROLE_WILDCARD, function (string $uuid) use ($repo) { |
|
101 | + $this->bind(static::ROLE_WILDCARD, function(string $uuid) use ($repo) { |
|
102 | 102 | return $repo->firstWithUuidOrFail($uuid); |
103 | 103 | }); |
104 | 104 |
@@ -37,7 +37,7 @@ |
||
37 | 37 | $this->prefix('{'.static::ROLE_WILDCARD.'}')->group(function () { |
38 | 38 | // admin::authorization.permissions.roles.detach |
39 | 39 | $this->delete('detach', [RolesController::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('roles')->name('roles.')->group(function () { |
|
37 | - $this->prefix('{'.static::ROLE_WILDCARD.'}')->group(function () { |
|
36 | + $this->prefix('roles')->name('roles.')->group(function() { |
|
37 | + $this->prefix('{'.static::ROLE_WILDCARD.'}')->group(function() { |
|
38 | 38 | // admin::authorization.permissions.roles.detach |
39 | 39 | $this->delete('detach', [RolesController::class, 'detach']) |
40 | 40 | ->name('detach'); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function bindings(PermissionsRepository $repo): void |
51 | 51 | { |
52 | - $this->bind(static::ROLE_WILDCARD, function (string $uuid, Route $route) use ($repo) { |
|
52 | + $this->bind(static::ROLE_WILDCARD, function(string $uuid, Route $route) use ($repo) { |
|
53 | 53 | /** @var \Arcanesoft\Foundation\Authorization\Models\Permission $permission */ |
54 | 54 | $permission = $route->parameter(PermissionsRoutes::PERMISSION_WILDCARD); |
55 | 55 |
@@ -34,57 +34,57 @@ |
||
34 | 34 | $this->name('administrators.')->prefix('administrators')->group(function () { |
35 | 35 | // admin::authorization.administrators.index |
36 | 36 | $this->get('/', [AdministratorsController::class, 'index']) |
37 | - ->name('index'); |
|
37 | + ->name('index'); |
|
38 | 38 | |
39 | 39 | // admin::authorization.administrators.datatable |
40 | 40 | $this->post('datatable', [AdministratorsController::class, 'datatable']) |
41 | - ->middleware(['ajax']) |
|
42 | - ->name('datatable'); |
|
41 | + ->middleware(['ajax']) |
|
42 | + ->name('datatable'); |
|
43 | 43 | |
44 | 44 | // admin::authorization.administrators.metrics |
45 | 45 | $this->get('metrics', [AdministratorsController::class, 'metrics']) |
46 | - ->name('metrics'); |
|
46 | + ->name('metrics'); |
|
47 | 47 | |
48 | 48 | // admin::authorization.administrators.create |
49 | 49 | $this->get('create', [AdministratorsController::class, 'create']) |
50 | - ->name('create'); |
|
50 | + ->name('create'); |
|
51 | 51 | |
52 | 52 | // admin::authorization.administrators.post |
53 | 53 | $this->post('store', [AdministratorsController::class, 'store']) |
54 | - ->name('store'); |
|
54 | + ->name('store'); |
|
55 | 55 | |
56 | 56 | $this->prefix('{'.static::WILDCARD_ADMIN.'}')->group(function () { |
57 | 57 | // admin::authorization.administrators.show |
58 | 58 | $this->get('/', [AdministratorsController::class, 'show']) |
59 | - ->name('show'); |
|
59 | + ->name('show'); |
|
60 | 60 | |
61 | 61 | // admin::authorization.administrators.edit |
62 | 62 | $this->get('edit', [AdministratorsController::class, 'edit']) |
63 | - ->name('edit'); |
|
63 | + ->name('edit'); |
|
64 | 64 | |
65 | 65 | // admin::authorization.administrators.update |
66 | 66 | $this->put('update', [AdministratorsController::class, 'update']) |
67 | - ->name('update'); |
|
67 | + ->name('update'); |
|
68 | 68 | |
69 | 69 | // admin::authorization.administrators.activate |
70 | 70 | $this->put('activate', [AdministratorsController::class, 'activate']) |
71 | - ->middleware(['ajax']) |
|
72 | - ->name('activate'); |
|
71 | + ->middleware(['ajax']) |
|
72 | + ->name('activate'); |
|
73 | 73 | |
74 | 74 | // admin::authorization.administrators.deactivate |
75 | 75 | $this->put('deactivate', [AdministratorsController::class, 'deactivate']) |
76 | - ->middleware(['ajax']) |
|
77 | - ->name('deactivate'); |
|
76 | + ->middleware(['ajax']) |
|
77 | + ->name('deactivate'); |
|
78 | 78 | |
79 | 79 | // admin::authorization.administrators.delete |
80 | 80 | $this->delete('delete', [AdministratorsController::class, 'delete']) |
81 | - ->middleware(['ajax']) |
|
82 | - ->name('delete'); |
|
81 | + ->middleware(['ajax']) |
|
82 | + ->name('delete'); |
|
83 | 83 | |
84 | 84 | // admin::authorization.administrators.restore |
85 | 85 | $this->put('restore', [AdministratorsController::class, 'restore']) |
86 | - ->middleware(['ajax']) |
|
87 | - ->name('restore'); |
|
86 | + ->middleware(['ajax']) |
|
87 | + ->name('restore'); |
|
88 | 88 | |
89 | 89 | static::mapRouteClasses([ |
90 | 90 | Administrators\SessionsRoutes::class |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | public function map(): void |
33 | 33 | { |
34 | - $this->name('administrators.')->prefix('administrators')->group(function () { |
|
34 | + $this->name('administrators.')->prefix('administrators')->group(function() { |
|
35 | 35 | // admin::authorization.administrators.index |
36 | 36 | $this->get('/', [AdministratorsController::class, 'index']) |
37 | 37 | ->name('index'); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->post('store', [AdministratorsController::class, 'store']) |
54 | 54 | ->name('store'); |
55 | 55 | |
56 | - $this->prefix('{'.static::WILDCARD_ADMIN.'}')->group(function () { |
|
56 | + $this->prefix('{'.static::WILDCARD_ADMIN.'}')->group(function() { |
|
57 | 57 | // admin::authorization.administrators.show |
58 | 58 | $this->get('/', [AdministratorsController::class, 'show']) |
59 | 59 | ->name('show'); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function bindings(AdministratorsRepository $repo): void |
102 | 102 | { |
103 | - $this->bind(static::WILDCARD_ADMIN, function (string $uuid) use ($repo) { |
|
103 | + $this->bind(static::WILDCARD_ADMIN, function(string $uuid) use ($repo) { |
|
104 | 104 | return $repo->firstWhereUuidOrFail($uuid); |
105 | 105 | }); |
106 | 106 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | 'description' => $resource->description, |
36 | 36 | 'administrators' => $resource->administrators_count, |
37 | 37 | 'locked' => $this->lockedBadge($resource), |
38 | - 'status' => with($resource->isActive(), function ($isActive) { |
|
38 | + 'status' => with($resource->isActive(), function($isActive) { |
|
39 | 39 | return [ |
40 | 40 | 'active' => $isActive, |
41 | 41 | 'label' => __($isActive ? 'Activated' : 'Deactivated'), |
@@ -39,7 +39,7 @@ |
||
39 | 39 | 'last_name' => $resource->last_name, |
40 | 40 | 'email' => $resource->email, |
41 | 41 | 'created_at' => $resource->created_at->format('Y-m-d H:i:s'), |
42 | - 'status' => with($resource->isActive(), function ($isActive) { |
|
42 | + 'status' => with($resource->isActive(), function($isActive) { |
|
43 | 43 | return [ |
44 | 44 | 'active' => $isActive, |
45 | 45 | 'label' => __($isActive ? 'Activated' : 'Deactivated'), |
@@ -35,7 +35,7 @@ |
||
35 | 35 | 'last_name' => $resource->last_name, |
36 | 36 | 'email' => $resource->email, |
37 | 37 | 'created_at' => $resource->created_at->format('Y-m-d H:i:s'), |
38 | - 'status' => with($resource->isActive(), function ($isActive) { |
|
38 | + 'status' => with($resource->isActive(), function($isActive) { |
|
39 | 39 | return [ |
40 | 40 | 'active' => $isActive, |
41 | 41 | 'label' => __($isActive ? 'Activated' : 'Deactivated'), |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $search = $this->searchQuery($request); |
63 | 63 | |
64 | - return $query->unless(empty($search), function (Builder $q) use ($search) { |
|
64 | + return $query->unless(empty($search), function(Builder $q) use ($search) { |
|
65 | 65 | $q->where('first_name', 'like', '%'.$search.'%') |
66 | 66 | ->orWhere('last_name', 'like', '%'.$search.'%') |
67 | 67 | ->orWhere('email', 'like', '%'.$search.'%'); |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | Column::make('last_name', 'Last Name')->sortable(), |
82 | 82 | Column::make('email', 'Email')->sortable(Column::SORT_ASC), |
83 | 83 | Column::make('created_at', 'Created at')->sortable()->align('center'), |
84 | - Column::make('status', 'Status', Column::DATATYPE_BADGE_ACTIVE)->sortable(null, function (Builder $query, Column $column): Builder { |
|
84 | + Column::make('status', 'Status', Column::DATATYPE_BADGE_ACTIVE)->sortable(null, function(Builder $query, Column $column): Builder { |
|
85 | 85 | return $query->orderBy('activated_at', $column->getSortDirection()); |
86 | 86 | })->align('center')->escaped(false), |
87 | 87 | ]; |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | Filter::select('display', 'Display', 'list', [ |
109 | 109 | 'list' => 'List', |
110 | 110 | 'only-trashed' => 'Only trashed', |
111 | - ])->query(function (Builder $query, $value): Builder { |
|
111 | + ])->query(function(Builder $query, $value): Builder { |
|
112 | 112 | return $query->onlyTrashed($value === 'only-trashed'); |
113 | 113 | }), |
114 | 114 | ]; |
@@ -126,44 +126,44 @@ discard block |
||
126 | 126 | { |
127 | 127 | $actions = []; |
128 | 128 | |
129 | - $actions[] = Action::link('show', 'Show', function () use ($user) { |
|
129 | + $actions[] = Action::link('show', 'Show', function() use ($user) { |
|
130 | 130 | return route('admin::authorization.users.show', [$user]); |
131 | - })->can(function () use ($user) { |
|
131 | + })->can(function() use ($user) { |
|
132 | 132 | return UsersPolicy::can('show', [$user]); |
133 | 133 | })->asIcon(); |
134 | 134 | |
135 | - $actions[] = Action::link('edit', 'Edit', function () use ($user) { |
|
135 | + $actions[] = Action::link('edit', 'Edit', function() use ($user) { |
|
136 | 136 | return route('admin::authorization.users.edit', [$user]); |
137 | - })->can(function () use ($user) { |
|
137 | + })->can(function() use ($user) { |
|
138 | 138 | return UsersPolicy::can('update', [$user]); |
139 | 139 | })->asIcon(); |
140 | 140 | |
141 | 141 | if ($user->isActive()) { |
142 | - $actions[] = Action::button('deactivate', 'Deactivate', function () use ($user) { |
|
142 | + $actions[] = Action::button('deactivate', 'Deactivate', function() use ($user) { |
|
143 | 143 | return "ARCANESOFT.emit('authorization::users.deactivate', {id: '{$user->getRouteKey()}'})"; |
144 | - })->can(function () use ($user) { |
|
144 | + })->can(function() use ($user) { |
|
145 | 145 | return UsersPolicy::can('deactivate', [$user]); |
146 | 146 | })->asIcon(); |
147 | 147 | } |
148 | 148 | else { |
149 | - $actions[] = Action::button('activate', 'Activate', function () use ($user) { |
|
149 | + $actions[] = Action::button('activate', 'Activate', function() use ($user) { |
|
150 | 150 | return "ARCANESOFT.emit('authorization::users.activate', {id: '{$user->getRouteKey()}'})"; |
151 | - })->can(function () use ($user) { |
|
151 | + })->can(function() use ($user) { |
|
152 | 152 | return UsersPolicy::can('activate', [$user]); |
153 | 153 | })->asIcon(); |
154 | 154 | } |
155 | 155 | |
156 | 156 | if ($user->trashed()) { |
157 | - $actions[] = Action::button('restore', 'Restore', function () use ($user) { |
|
157 | + $actions[] = Action::button('restore', 'Restore', function() use ($user) { |
|
158 | 158 | return "ARCANESOFT.emit('authorization::users.restore', {id: '{$user->getRouteKey()}'})"; |
159 | - })->can(function () use ($user) { |
|
159 | + })->can(function() use ($user) { |
|
160 | 160 | return UsersPolicy::can('restore', [$user]); |
161 | 161 | })->asIcon(); |
162 | 162 | } |
163 | 163 | |
164 | - $actions[] = Action::button('delete', 'Delete', function () use ($user) { |
|
164 | + $actions[] = Action::button('delete', 'Delete', function() use ($user) { |
|
165 | 165 | return "ARCANESOFT.emit('authorization::users.delete', {id: '{$user->getRouteKey()}'})"; |
166 | - })->can(function () use ($user) { |
|
166 | + })->can(function() use ($user) { |
|
167 | 167 | return UsersPolicy::can('delete', [$user]); |
168 | 168 | })->asIcon(); |
169 | 169 |
@@ -144,8 +144,7 @@ |
||
144 | 144 | })->can(function () use ($user) { |
145 | 145 | return UsersPolicy::can('deactivate', [$user]); |
146 | 146 | })->asIcon(); |
147 | - } |
|
148 | - else { |
|
147 | + } else { |
|
149 | 148 | $actions[] = Action::button('activate', 'Activate', function () use ($user) { |
150 | 149 | return "ARCANESOFT.emit('authorization::users.activate', {id: '{$user->getRouteKey()}'})"; |
151 | 150 | })->can(function () use ($user) { |
@@ -63,8 +63,8 @@ |
||
63 | 63 | |
64 | 64 | return $query->unless(empty($search), function (Builder $q) use ($search): Builder { |
65 | 65 | return $q->where('first_name', 'like', '%'.$search.'%') |
66 | - ->orWhere('last_name', 'like', '%'.$search.'%') |
|
67 | - ->orWhere('email', 'like', '%'.$search.'%'); |
|
66 | + ->orWhere('last_name', 'like', '%'.$search.'%') |
|
67 | + ->orWhere('email', 'like', '%'.$search.'%'); |
|
68 | 68 | }); |
69 | 69 | } |
70 | 70 |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $search = $this->searchQuery($request); |
63 | 63 | |
64 | - return $query->unless(empty($search), function (Builder $q) use ($search): Builder { |
|
64 | + return $query->unless(empty($search), function(Builder $q) use ($search): Builder { |
|
65 | 65 | return $q->where('first_name', 'like', '%'.$search.'%') |
66 | 66 | ->orWhere('last_name', 'like', '%'.$search.'%') |
67 | 67 | ->orWhere('email', 'like', '%'.$search.'%'); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | Column::make('last_name', 'Last Name')->sortable(), |
81 | 81 | Column::make('email', 'Email')->sortable(), |
82 | 82 | Column::make('created_at', 'Created at')->sortable()->align('center'), |
83 | - Column::make('status', 'Status', Column::DATATYPE_BADGE_ACTIVE)->sortable(null, function (Builder $query, Column $column): Builder { |
|
83 | + Column::make('status', 'Status', Column::DATATYPE_BADGE_ACTIVE)->sortable(null, function(Builder $query, Column $column): Builder { |
|
84 | 84 | return $query->orderBy('activated_at', $column->getSortDirection()); |
85 | 85 | })->align('center')->escaped(false), |
86 | 86 | ]; |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | Filter::select('display', 'Display', 'list', [ |
108 | 108 | 'list' => 'List', |
109 | 109 | 'only-trashed' => 'Only trashed', |
110 | - ])->query(function (Builder $query, $value): Builder { |
|
110 | + ])->query(function(Builder $query, $value): Builder { |
|
111 | 111 | return $query->onlyTrashed($value === 'only-trashed'); |
112 | 112 | }), |
113 | 113 | ]; |
@@ -125,44 +125,44 @@ discard block |
||
125 | 125 | { |
126 | 126 | $actions = []; |
127 | 127 | |
128 | - $actions[] = Action::link('show', 'Show', function () use ($administrator) { |
|
128 | + $actions[] = Action::link('show', 'Show', function() use ($administrator) { |
|
129 | 129 | return route('admin::authorization.administrators.show', [$administrator]); |
130 | - })->can(function () use ($administrator) { |
|
130 | + })->can(function() use ($administrator) { |
|
131 | 131 | return AdministratorsPolicy::can('show', [$administrator]); |
132 | 132 | })->asIcon(); |
133 | 133 | |
134 | - $actions[] = Action::link('edit', 'Edit', function () use ($administrator) { |
|
134 | + $actions[] = Action::link('edit', 'Edit', function() use ($administrator) { |
|
135 | 135 | return route('admin::authorization.administrators.edit', [$administrator]); |
136 | - })->can(function () use ($administrator) { |
|
136 | + })->can(function() use ($administrator) { |
|
137 | 137 | return AdministratorsPolicy::can('update', [$administrator]); |
138 | 138 | })->asIcon(); |
139 | 139 | |
140 | 140 | if ($administrator->isActive()) { |
141 | - $actions[] = Action::button('deactivate', 'Deactivate', function () use ($administrator) { |
|
141 | + $actions[] = Action::button('deactivate', 'Deactivate', function() use ($administrator) { |
|
142 | 142 | return "ARCANESOFT.emit('authorization::administrators.deactivate', {id: '{$administrator->getRouteKey()}'})"; |
143 | - })->can(function () use ($administrator) { |
|
143 | + })->can(function() use ($administrator) { |
|
144 | 144 | return AdministratorsPolicy::can('deactivate', [$administrator]); |
145 | 145 | })->asIcon(); |
146 | 146 | } |
147 | 147 | else { |
148 | - $actions[] = Action::button('activate', 'Activate', function () use ($administrator) { |
|
148 | + $actions[] = Action::button('activate', 'Activate', function() use ($administrator) { |
|
149 | 149 | return "ARCANESOFT.emit('authorization::administrators.activate', {id: '{$administrator->getRouteKey()}'})"; |
150 | - })->can(function () use ($administrator) { |
|
150 | + })->can(function() use ($administrator) { |
|
151 | 151 | return AdministratorsPolicy::can('activate', [$administrator]); |
152 | 152 | })->asIcon(); |
153 | 153 | } |
154 | 154 | |
155 | 155 | if ($administrator->trashed()) { |
156 | - $actions[] = Action::button('restore', 'Restore', function () use ($administrator) { |
|
156 | + $actions[] = Action::button('restore', 'Restore', function() use ($administrator) { |
|
157 | 157 | return "ARCANESOFT.emit('authorization::administrators.restore', {id: '{$administrator->getRouteKey()}'})"; |
158 | - })->can(function () use ($administrator) { |
|
158 | + })->can(function() use ($administrator) { |
|
159 | 159 | return AdministratorsPolicy::can('restore', [$administrator]); |
160 | 160 | })->asIcon(); |
161 | 161 | } |
162 | 162 | |
163 | - $actions[] = Action::button('delete', 'Delete', function () use ($administrator) { |
|
163 | + $actions[] = Action::button('delete', 'Delete', function() use ($administrator) { |
|
164 | 164 | return "ARCANESOFT.emit('authorization::administrators.delete', {id: '{$administrator->getRouteKey()}'})"; |
165 | - })->can(function () use ($administrator) { |
|
165 | + })->can(function() use ($administrator) { |
|
166 | 166 | return AdministratorsPolicy::can('delete', [$administrator]); |
167 | 167 | })->asIcon(); |
168 | 168 |
@@ -143,8 +143,7 @@ |
||
143 | 143 | })->can(function () use ($administrator) { |
144 | 144 | return AdministratorsPolicy::can('deactivate', [$administrator]); |
145 | 145 | })->asIcon(); |
146 | - } |
|
147 | - else { |
|
146 | + } else { |
|
148 | 147 | $actions[] = Action::button('activate', 'Activate', function () use ($administrator) { |
149 | 148 | return "ARCANESOFT.emit('authorization::administrators.activate', {id: '{$administrator->getRouteKey()}'})"; |
150 | 149 | })->can(function () use ($administrator) { |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | $search = $this->searchQuery($request); |
63 | 63 | |
64 | - return $query->unless(empty($search), function (Builder $q) use ($search) { |
|
64 | + return $query->unless(empty($search), function(Builder $q) use ($search) { |
|
65 | 65 | $q->where('email', 'like', '%'.$search.'%'); |
66 | 66 | }); |
67 | 67 | } |
@@ -91,36 +91,36 @@ discard block |
||
91 | 91 | { |
92 | 92 | $actions = []; |
93 | 93 | |
94 | - $actions[] = Action::link('show', 'Show', function () use ($role) { |
|
94 | + $actions[] = Action::link('show', 'Show', function() use ($role) { |
|
95 | 95 | return route('admin::authorization.roles.show', [$role]); |
96 | - })->can(function () use ($role) { |
|
96 | + })->can(function() use ($role) { |
|
97 | 97 | return PasswordResetsPolicy::can('show', [$role]); |
98 | 98 | })->asIcon(); |
99 | 99 | |
100 | - $actions[] = Action::link('edit', 'Edit', function () use ($role) { |
|
100 | + $actions[] = Action::link('edit', 'Edit', function() use ($role) { |
|
101 | 101 | return route('admin::authorization.roles.edit', [$role]); |
102 | - })->can(function () use ($role) { |
|
102 | + })->can(function() use ($role) { |
|
103 | 103 | return PasswordResetsPolicy::can('update', [$role]); |
104 | 104 | })->asIcon(); |
105 | 105 | |
106 | 106 | if ($role->isActive()) { |
107 | - $actions[] = Action::button('deactivate', 'Deactivate', function () use ($role) { |
|
107 | + $actions[] = Action::button('deactivate', 'Deactivate', function() use ($role) { |
|
108 | 108 | return "ARCANESOFT.emit('authorization::roles.deactivate', {id: '{$role->getRouteKey()}'})"; |
109 | - })->can(function () use ($role) { |
|
109 | + })->can(function() use ($role) { |
|
110 | 110 | return PasswordResetsPolicy::can('deactivate', [$role]); |
111 | 111 | })->asIcon(); |
112 | 112 | } |
113 | 113 | else { |
114 | - $actions[] = Action::button('activate', 'Activate', function () use ($role) { |
|
114 | + $actions[] = Action::button('activate', 'Activate', function() use ($role) { |
|
115 | 115 | return "ARCANESOFT.emit('authorization::roles.activate', {id: '{$role->getRouteKey()}'})"; |
116 | - })->can(function () use ($role) { |
|
116 | + })->can(function() use ($role) { |
|
117 | 117 | return PasswordResetsPolicy::can('activate', [$role]); |
118 | 118 | })->asIcon(); |
119 | 119 | } |
120 | 120 | |
121 | - $actions[] = Action::button('delete', 'Delete', function () use ($role) { |
|
121 | + $actions[] = Action::button('delete', 'Delete', function() use ($role) { |
|
122 | 122 | return "ARCANESOFT.emit('authorization::roles.delete', {id: '{$role->getRouteKey()}'})"; |
123 | - })->can(function () use ($role) { |
|
123 | + })->can(function() use ($role) { |
|
124 | 124 | return PasswordResetsPolicy::can('delete', [$role]); |
125 | 125 | })->asIcon(); |
126 | 126 |
@@ -109,8 +109,7 @@ |
||
109 | 109 | })->can(function () use ($role) { |
110 | 110 | return PasswordResetsPolicy::can('deactivate', [$role]); |
111 | 111 | })->asIcon(); |
112 | - } |
|
113 | - else { |
|
112 | + } else { |
|
114 | 113 | $actions[] = Action::button('activate', 'Activate', function () use ($role) { |
115 | 114 | return "ARCANESOFT.emit('authorization::roles.activate', {id: '{$role->getRouteKey()}'})"; |
116 | 115 | })->can(function () use ($role) { |