@@ -25,7 +25,7 @@ |
||
| 25 | 25 | |
| 26 | 26 | protected function createTable(string $table) |
| 27 | 27 | { |
| 28 | - $this->create($table, function (Blueprint $table) { |
|
| 28 | + $this->create($table, function(Blueprint $table) { |
|
| 29 | 29 | $table->bigIncrements('id'); |
| 30 | 30 | $table->string('name')->unique(); |
| 31 | 31 | $table->timestamps(); |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | |
| 68 | 68 | protected function createPivot(string $table, string $first_table, string $second_table, string $first_key, string $second_key) |
| 69 | 69 | { |
| 70 | - $this->create($table, function (Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) { |
|
| 70 | + $this->create($table, function(Blueprint $table) use ($first_table, $second_table, $first_key, $second_key) { |
|
| 71 | 71 | $table->unsignedBigInteger($first_key); |
| 72 | 72 | $table->unsignedBigInteger($second_key); |
| 73 | 73 | |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | |
| 31 | 31 | public function hasRootRole(): bool |
| 32 | 32 | { |
| 33 | - return $this->cache(__FUNCTION__, function () { |
|
| 33 | + return $this->cache(__FUNCTION__, function() { |
|
| 34 | 34 | return $this->roles() |
| 35 | 35 | ->where('is_root', true) |
| 36 | 36 | ->exists(); |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | public function hasRole(...$roles): bool |
| 107 | 107 | { |
| 108 | - return $this->cache(__FUNCTION__, function () use ($roles) { |
|
| 108 | + return $this->cache(__FUNCTION__, function() use ($roles) { |
|
| 109 | 109 | foreach (Arr::flatten($roles) as $role) { |
| 110 | 110 | if ($this->roles->contains('name', $role)) { |
| 111 | 111 | return true; |
@@ -123,9 +123,9 @@ discard block |
||
| 123 | 123 | */ |
| 124 | 124 | public function hasRoles(...$roles): bool |
| 125 | 125 | { |
| 126 | - return $this->cache(__FUNCTION__, function () use ($roles) { |
|
| 126 | + return $this->cache(__FUNCTION__, function() use ($roles) { |
|
| 127 | 127 | foreach (Arr::flatten($roles) as $role) { |
| 128 | - if (! $this->roles->contains('name', $role)) { |
|
| 128 | + if ( ! $this->roles->contains('name', $role)) { |
|
| 129 | 129 | return false; |
| 130 | 130 | } |
| 131 | 131 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | */ |
| 211 | 211 | public function hasPermission($permission): bool |
| 212 | 212 | { |
| 213 | - return $this->cache(__FUNCTION__, function () use ($permission) { |
|
| 213 | + return $this->cache(__FUNCTION__, function() use ($permission) { |
|
| 214 | 214 | $permission = $this->permissionId($permission); |
| 215 | 215 | |
| 216 | 216 | return $this->permissions() |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | ->exists() |
| 219 | 219 | || |
| 220 | 220 | $this->roles() |
| 221 | - ->whereHas('permissions', function (Builder $builder) use ($permission) { |
|
| 221 | + ->whereHas('permissions', function(Builder $builder) use ($permission) { |
|
| 222 | 222 | $builder->searchBy($permission); |
| 223 | 223 | })->exists(); |
| 224 | 224 | }, $permission); |
@@ -231,9 +231,9 @@ discard block |
||
| 231 | 231 | */ |
| 232 | 232 | public function hasPermissions(...$permissions): bool |
| 233 | 233 | { |
| 234 | - return $this->cache(__FUNCTION__, function () use ($permissions) { |
|
| 234 | + return $this->cache(__FUNCTION__, function() use ($permissions) { |
|
| 235 | 235 | foreach (Arr::flatten($permissions) as $permission) { |
| 236 | - if (! $this->hasPermission($permission)) { |
|
| 236 | + if ( ! $this->hasPermission($permission)) { |
|
| 237 | 237 | return false; |
| 238 | 238 | } |
| 239 | 239 | } |