Skip to content

Commit 1861eeb

Browse files
authored
Merge pull request #113 from ivan-cc/master
Fix pivot table name (`role_user`).
2 parents 261e3f7 + d0961c7 commit 1861eeb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Traits/HasRoleAndPermission.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ trait HasRoleAndPermission
3434
*/
3535
public function roles()
3636
{
37-
return $this->belongsToMany(config('roles.models.role'))->withTimestamps();
37+
return $this->belongsToMany(config('roles.models.role'), config('roles.roleUserTable'))->withTimestamps();
3838
}
3939

4040
/**

src/Traits/RoleHasRelations.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function permissions()
2424
*/
2525
public function users()
2626
{
27-
return $this->belongsToMany(config('roles.models.defaultUser'))->withTimestamps();
27+
return $this->belongsToMany(config('roles.models.defaultUser'), config('roles.roleUserTable'))->withTimestamps();
2828
}
2929

3030
/**

0 commit comments

Comments
 (0)