@@ -36,11 +36,13 @@ |
||
| 36 | 36 | |
| 37 | 37 | public function update() |
| 38 | 38 | { |
| 39 | - if ($this->getRules()) |
|
| 40 | - $this->validate(); |
|
| 39 | + if ($this->getRules()) { |
|
| 40 | + $this->validate(); |
|
| 41 | + } |
|
| 41 | 42 | |
| 42 | - if ($this->selectedRoles[0] == "null") |
|
| 43 | - $this->selectedRoles = []; |
|
| 43 | + if ($this->selectedRoles[0] == "null") { |
|
| 44 | + $this->selectedRoles = []; |
|
| 45 | + } |
|
| 44 | 46 | |
| 45 | 47 | $this->admin->roles()->sync($this->selectedRoles); |
| 46 | 48 | |
@@ -55,8 +55,9 @@ discard block |
||
| 55 | 55 | |
| 56 | 56 | public function update() |
| 57 | 57 | { |
| 58 | - if ($this->getRules()) |
|
| 59 | - $this->validate(); |
|
| 58 | + if ($this->getRules()) { |
|
| 59 | + $this->validate(); |
|
| 60 | + } |
|
| 60 | 61 | |
| 61 | 62 | if ($this->role->is_super_admin()) { |
| 62 | 63 | $this->dispatchBrowserEvent('show-message', ['type' => 'error', 'message' => __('CannotUpdateMessage', ['name' => __('Role')])]); |
@@ -84,8 +85,9 @@ discard block |
||
| 84 | 85 | $dashKey = str_replace('.', '-', $key); |
| 85 | 86 | $value = is_array($value) ? array_filter($value) : $value; |
| 86 | 87 | |
| 87 | - if (empty($value)) |
|
| 88 | - continue; |
|
| 88 | + if (empty($value)) { |
|
| 89 | + continue; |
|
| 90 | + } |
|
| 89 | 91 | |
| 90 | 92 | $this->access[$dashKey] = $value; |
| 91 | 93 | |
@@ -68,5 +68,5 @@ |
||
| 68 | 68 | Route::prefix('admins')->middleware('dynamicAcl')->name('admins.')->group(function (){ |
| 69 | 69 | Route::get('/', \EasyPanel\Http\Livewire\Admins\Lists::class)->name('lists'); |
| 70 | 70 | // Route::get('/create', \EasyPanel\Http\Livewire\Admins\Create::class)->name('create'); |
| 71 | - Route::get('/update/{admin}', \EasyPanel\Http\Livewire\Admins\Update::class)->name('update'); |
|
| 71 | + Route::get('/update/{admin}', \EasyPanel\Http\Livewire\Admins\Update::class)->name('update'); |
|
| 72 | 72 | }); |
@@ -19,8 +19,9 @@ |
||
| 19 | 19 | if ($crud->with_acl) { |
| 20 | 20 | $middleware[] = "dynamicAcl"; |
| 21 | 21 | |
| 22 | - if ($crud->with_policy) |
|
| 23 | - $middleware[] = "authorize"; |
|
| 22 | + if ($crud->with_policy) { |
|
| 23 | + $middleware[] = "authorize"; |
|
| 24 | + } |
|
| 24 | 25 | } |
| 25 | 26 | |
| 26 | 27 | Route::prefix($crud->route)->middleware($middleware)->name("{$crud->route}.")->group(function () use ($component, $crud, $crudConfig) { |
@@ -23,8 +23,9 @@ |
||
| 23 | 23 | 'is_superuser' => $is_super, |
| 24 | 24 | ]); |
| 25 | 25 | |
| 26 | - if($is_super) |
|
| 27 | - $this->makeSuperAdminRole($user); |
|
| 26 | + if($is_super) { |
|
| 27 | + $this->makeSuperAdminRole($user); |
|
| 28 | + } |
|
| 28 | 29 | |
| 29 | 30 | return [ |
| 30 | 31 | 'type' => 'success', |