diff --git a/src/Database/Concerns/HasAbilities.php b/src/Database/Concerns/HasAbilities.php index 4ad467d..e53d2e8 100644 --- a/src/Database/Concerns/HasAbilities.php +++ b/src/Database/Concerns/HasAbilities.php @@ -42,7 +42,7 @@ public function abilities(): MorphToMany Models::classname(Ability::class), 'entity', Models::table('permissions') - )->withPivot('forbidden', 'scope'); + )->withPivot('id', 'forbidden', 'scope'); return Models::scope()->applyToRelation($relation); } diff --git a/src/Database/Concerns/HasRoles.php b/src/Database/Concerns/HasRoles.php index 47c45da..8e52ad0 100644 --- a/src/Database/Concerns/HasRoles.php +++ b/src/Database/Concerns/HasRoles.php @@ -41,7 +41,7 @@ public function roles(): MorphToMany Models::classname(Role::class), 'entity', Models::table('assigned_roles') - )->withPivot('scope'); + )->withPivot('id', 'scope'); return Models::scope()->applyToRelation($relation); } diff --git a/src/Database/Concerns/IsAbility.php b/src/Database/Concerns/IsAbility.php index 843ae21..4b4953b 100644 --- a/src/Database/Concerns/IsAbility.php +++ b/src/Database/Concerns/IsAbility.php @@ -155,7 +155,7 @@ public function roles(): MorphToMany Models::classname(Role::class), 'entity', Models::table('permissions') - )->withPivot('forbidden', 'scope'); + )->withPivot('id', 'forbidden', 'scope'); return Models::scope()->applyToRelation($relation); } @@ -171,7 +171,7 @@ public function users(): MorphToMany Models::classname(User::class), 'entity', Models::table('permissions') - )->withPivot('forbidden', 'scope'); + )->withPivot('id', 'forbidden', 'scope'); return Models::scope()->applyToRelation($relation); } diff --git a/src/Database/Concerns/IsRole.php b/src/Database/Concerns/IsRole.php index 18a84be..c5af55b 100644 --- a/src/Database/Concerns/IsRole.php +++ b/src/Database/Concerns/IsRole.php @@ -52,7 +52,7 @@ public function users(): MorphToMany Models::classname(User::class), 'entity', Models::table('assigned_roles') - )->withPivot('scope'); + )->withPivot('id', 'scope'); return Models::scope()->applyToRelation($relation); }