From 48fb99b400f72b3f816a58a08cf485617ab44656 Mon Sep 17 00:00:00 2001 From: "P. K. Tharindu" Date: Wed, 4 Aug 2021 08:57:53 +0530 Subject: [PATCH] add missing `foreignPivotKey` to roles relation --- src/Traits/HasRoles.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Traits/HasRoles.php b/src/Traits/HasRoles.php index 1b60794..f771089 100644 --- a/src/Traits/HasRoles.php +++ b/src/Traits/HasRoles.php @@ -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'); } /**