1 | <?php |
||
8 | trait HasRoleAndPermission |
||
9 | { |
||
10 | use HasRole { |
||
11 | HasRole::getPermissions as getRolePermissions; |
||
12 | } |
||
13 | |||
14 | use InteractsWithPermission; |
||
15 | |||
16 | /** |
||
17 | * Get all user permissions slug. |
||
18 | * |
||
19 | * @return array|null |
||
20 | */ |
||
21 | public function getPermissions(): array |
||
22 | { |
||
23 | $rolePermissions = $this->getRolePermissions(); |
||
|
|||
24 | $userPermissions = $this->permissions->pluck('slug')->toArray(); |
||
25 | |||
26 | return collect($userPermissions)->merge($rolePermissions)->unique()->toArray(); |
||
27 | } |
||
28 | } |
||
29 |
This check marks calls to methods that do not seem to exist on an object.
This is most likely the result of a method being renamed without all references to it being renamed likewise.