@@ -26,8 +26,9 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | protected function passesAuthorization(): bool |
| 28 | 28 | { |
| 29 | - if (method_exists($this, 'authorize')) |
|
| 30 | - return app()->call([$this, 'authorize']); |
|
| 29 | + if (method_exists($this, 'authorize')) { |
|
| 30 | + return app()->call([$this, 'authorize']); |
|
| 31 | + } |
|
| 31 | 32 | |
| 32 | 33 | return true; |
| 33 | 34 | } |
@@ -32,8 +32,7 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | if ($type === 'method') { |
| 34 | 34 | $this->handleMethodAction($payload['method'], $payload['params']); |
| 35 | - } |
|
| 36 | - elseif ($type === 'model') { |
|
| 35 | + } elseif ($type === 'model') { |
|
| 37 | 36 | $this->handleModelAction($payload['name'], $payload['value']); |
| 38 | 37 | } |
| 39 | 38 | } |
@@ -60,8 +59,9 @@ discard block |
||
| 60 | 59 | { |
| 61 | 60 | $method = 'updating'.Str::studly($property); |
| 62 | 61 | |
| 63 | - if (method_exists($this, $method)) |
|
| 64 | - $this->$method(); |
|
| 62 | + if (method_exists($this, $method)) { |
|
| 63 | + $this->$method(); |
|
| 64 | + } |
|
| 65 | 65 | |
| 66 | 66 | $this->{$property} = $value; |
| 67 | 67 | } |
@@ -42,8 +42,9 @@ discard block |
||
| 42 | 42 | { |
| 43 | 43 | $data = $this->data(); |
| 44 | 44 | |
| 45 | - if (method_exists($this, 'initializeWithPagination')) |
|
| 46 | - $this->initializeWithPagination(); |
|
| 45 | + if (method_exists($this, 'initializeWithPagination')) { |
|
| 46 | + $this->initializeWithPagination(); |
|
| 47 | + } |
|
| 47 | 48 | |
| 48 | 49 | /** @var \Illuminate\View\View $view */ |
| 49 | 50 | $view = app()->call([$this, 'render']); |
@@ -87,8 +88,9 @@ discard block |
||
| 87 | 88 | |
| 88 | 89 | $actions = (array) $request->input('actions'); |
| 89 | 90 | |
| 90 | - if ( ! empty($actions)) |
|
| 91 | - $this->handleComponentActions($actions); |
|
| 91 | + if ( ! empty($actions)) { |
|
| 92 | + $this->handleComponentActions($actions); |
|
| 93 | + } |
|
| 92 | 94 | |
| 93 | 95 | return $this; |
| 94 | 96 | } |
@@ -88,8 +88,9 @@ |
||
| 88 | 88 | */ |
| 89 | 89 | public function make(string $name): Component |
| 90 | 90 | { |
| 91 | - if ( ! $this->hasComponent($name)) |
|
| 92 | - throw ComponentNotFound::make($name); |
|
| 91 | + if ( ! $this->hasComponent($name)) { |
|
| 92 | + throw ComponentNotFound::make($name); |
|
| 93 | + } |
|
| 93 | 94 | |
| 94 | 95 | return $this->app->make($this->components[$name]); |
| 95 | 96 | } |
@@ -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 | } |
@@ -54,11 +54,13 @@ |
||
| 54 | 54 | { |
| 55 | 55 | $session = $event->session; |
| 56 | 56 | |
| 57 | - if ($session->isVisitor()) |
|
| 58 | - return; |
|
| 57 | + if ($session->isVisitor()) { |
|
| 58 | + return; |
|
| 59 | + } |
|
| 59 | 60 | |
| 60 | - if ( ! $session->isSameUser($authenticated = $this->getAuthenticated())) |
|
| 61 | - return; |
|
| 61 | + if ( ! $session->isSameUser($authenticated = $this->getAuthenticated())) { |
|
| 62 | + return; |
|
| 63 | + } |
|
| 62 | 64 | |
| 63 | 65 | $authenticated->forceFill([ |
| 64 | 66 | 'last_activity_at' => $session->last_activity_at, |
@@ -72,8 +72,9 @@ |
||
| 72 | 72 | */ |
| 73 | 73 | public function verified($date = null): self |
| 74 | 74 | { |
| 75 | - if (is_null($date)) |
|
| 76 | - $date = now(); |
|
| 75 | + if (is_null($date)) { |
|
| 76 | + $date = now(); |
|
| 77 | + } |
|
| 77 | 78 | |
| 78 | 79 | return $this->state([ |
| 79 | 80 | 'email_verified_at' => $date === false ? null : $date, |
@@ -170,10 +170,11 @@ |
||
| 170 | 170 | $data = $request->getValidatedData(); |
| 171 | 171 | $rolesRepo->updateOne($role, $data); |
| 172 | 172 | |
| 173 | - if (empty($permissions = $data['permissions'] ?: [])) |
|
| 174 | - $rolesRepo->detachAllPermissions($role); |
|
| 175 | - else |
|
| 176 | - $rolesRepo->syncPermissionsByUuids($role, $permissions); |
|
| 173 | + if (empty($permissions = $data['permissions'] ?: [])) { |
|
| 174 | + $rolesRepo->detachAllPermissions($role); |
|
| 175 | + } else { |
|
| 176 | + $rolesRepo->syncPermissionsByUuids($role, $permissions); |
|
| 177 | + } |
|
| 177 | 178 | |
| 178 | 179 | return redirect()->route('admin::auth.roles.show', [$role]); |
| 179 | 180 | } |
@@ -186,8 +186,9 @@ discard block |
||
| 186 | 186 | */ |
| 187 | 187 | public function syncPermissionsByIds(Role $role, array $ids): array |
| 188 | 188 | { |
| 189 | - if (empty($ids)) |
|
| 190 | - return []; |
|
| 189 | + if (empty($ids)) { |
|
| 190 | + return []; |
|
| 191 | + } |
|
| 191 | 192 | |
| 192 | 193 | event(new SyncingPermissions($role, $ids)); |
| 193 | 194 | $synced = $role->permissions()->sync($ids); |
@@ -307,8 +308,9 @@ discard block |
||
| 307 | 308 | { |
| 308 | 309 | $roles = $this->get(); |
| 309 | 310 | |
| 310 | - if ($admin->isSuperAdmin()) |
|
| 311 | - return $roles; |
|
| 311 | + if ($admin->isSuperAdmin()) { |
|
| 312 | + return $roles; |
|
| 313 | + } |
|
| 312 | 314 | |
| 313 | 315 | return $roles->reject(function (Role $role) { |
| 314 | 316 | return $role->isAdministrator(); |