@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | /** |
| 51 | 51 | * Check if the user has a role or roles. |
| 52 | 52 | * |
| 53 | - * @param int|string|array $role |
|
| 53 | + * @param string $role |
|
| 54 | 54 | * @param bool $all |
| 55 | 55 | * @return bool |
| 56 | 56 | */ |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | /** |
| 219 | 219 | * Check if the user has a permission or permissions. |
| 220 | 220 | * |
| 221 | - * @param int|string|array $permission |
|
| 221 | + * @param string $permission |
|
| 222 | 222 | * @param bool $all |
| 223 | 223 | * @return bool |
| 224 | 224 | */ |
@@ -47,8 +47,9 @@ |
||
| 47 | 47 | if(!$this->roles){ |
| 48 | 48 | $this->roles = $this->roles()->get(); |
| 49 | 49 | |
| 50 | - foreach($this->roles as $role) |
|
| 51 | - $this->roles = $this->roles->merge($role->descendants()); |
|
| 50 | + foreach($this->roles as $role) { |
|
| 51 | + $this->roles = $this->roles->merge($role->descendants()); |
|
| 52 | + } |
|
| 52 | 53 | } |
| 53 | 54 | return $this->roles; |
| 54 | 55 | } |
@@ -62,8 +62,9 @@ |
||
| 62 | 62 | public function descendants() |
| 63 | 63 | { |
| 64 | 64 | $descendants = $this->where('parent_id', '=', $this->id)->get(); |
| 65 | - foreach($descendants as $descendant) |
|
| 66 | - $descendants = $descendants->merge($descendant->descendants()); |
|
| 65 | + foreach($descendants as $descendant) { |
|
| 66 | + $descendants = $descendants->merge($descendant->descendants()); |
|
| 67 | + } |
|
| 67 | 68 | return $descendants; |
| 68 | 69 | } |
| 69 | 70 | |