Skip to content

Commit

Permalink
add missing foreignPivotKey to roles relation
Browse files Browse the repository at this point in the history
  • Loading branch information
pktharindu authored Aug 4, 2021
1 parent 309ffe1 commit 48fb99b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ trait HasRoles
*/
public function roles()
{
return $this->belongsToMany(Role::class, config('nova-permissions.table_names.role_user', 'role_user'))->with('getPermissions');
return $this->belongsToMany(Role::class, config('nova-permissions.table_names.role_user', 'role_user'), 'user_id')->with('getPermissions');
}

/**
Expand Down

0 comments on commit 48fb99b

Please sign in to comment.