1 | <?php |
||
2 | |||
3 | namespace jeremykenedy\LaravelRoles\Traits; |
||
4 | |||
5 | use Illuminate\Database\Eloquent\Relations\BelongsToMany; |
||
6 | |||
7 | trait PermissionHasRelations |
||
8 | { |
||
9 | /** |
||
10 | * Permission belongs to many roles. |
||
11 | * |
||
12 | * @return BelongsToMany |
||
13 | */ |
||
14 | public function roles() |
||
15 | { |
||
16 | return $this->belongsToMany(config('roles.models.role'))->withTimestamps(); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
17 | } |
||
18 | |||
19 | /** |
||
20 | * Permission belongs to many users. |
||
21 | * |
||
22 | * @return BelongsToMany |
||
23 | */ |
||
24 | public function users() |
||
25 | { |
||
26 | return $this->belongsToMany(config('roles.models.defaultUser'))->withTimestamps(); |
||
27 | } |
||
28 | } |
||
29 |