@@ -134,7 +134,7 @@ |
||
134 | 134 | { |
135 | 135 | parent::boot(); |
136 | 136 | |
137 | - static::deleting(function ($permission) { |
|
137 | + static::deleting(function($permission) { |
|
138 | 138 | $permission->users()->detach(); |
139 | 139 | $permission->level()->dissociate()->save(); |
140 | 140 | }); |
@@ -2,8 +2,8 @@ |
||
2 | 2 | |
3 | 3 | namespace z1haze\Acl\Traits; |
4 | 4 | |
5 | -use z1haze\Acl\Exceptions\LevelNotFoundException; |
|
6 | 5 | use Illuminate\Support\Facades\Cache; |
6 | +use z1haze\Acl\Exceptions\LevelNotFoundException; |
|
7 | 7 | use z1haze\Acl\Models\Level; |
8 | 8 | |
9 | 9 | trait UserAndPermission |
@@ -3,9 +3,9 @@ |
||
3 | 3 | namespace z1haze\Acl\Traits; |
4 | 4 | |
5 | 5 | use Illuminate\Support\Collection; |
6 | +use Illuminate\Support\Facades\Cache; |
|
6 | 7 | use ReflectionClass; |
7 | 8 | use z1haze\Acl\Exceptions\PermissionNotFoundException; |
8 | -use Illuminate\Support\Facades\Cache; |
|
9 | 9 | use z1haze\Acl\Models\Level; |
10 | 10 | use z1haze\Acl\Models\Permission; |
11 | 11 |
@@ -384,7 +384,7 @@ |
||
384 | 384 | * for modifyPermissions |
385 | 385 | * |
386 | 386 | * @param $permissions |
387 | - * @param $action |
|
387 | + * @param string $action |
|
388 | 388 | * @return array |
389 | 389 | * @throws PermissionNotFoundException |
390 | 390 | */ |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | |
366 | 366 | $permissionObjects = $this->buildPermissionsArray($permissions, $action); |
367 | 367 | |
368 | - switch($action) { |
|
368 | + switch ($action) { |
|
369 | 369 | case 'add': |
370 | 370 | // Add and negate call the same method |
371 | 371 | case 'negate': |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | if (is_a($this, config('laravel-acl.level'))) { |
461 | 461 | $this->clearPermissions(); |
462 | 462 | |
463 | - config('laravel-acl.permission', Permission::class)::whereIn('id', array_map(function ($permission) { |
|
463 | + config('laravel-acl.permission', Permission::class)::whereIn('id', array_map(function($permission) { |
|
464 | 464 | return $permission->id; |
465 | 465 | }, $permissionObjects)) |
466 | 466 | ->update(['level_id' => $this->id]); |