diff --git a/src/Database/Concerns/HasAbilities.php b/src/Database/Concerns/HasAbilities.php index db7df8e5..4ad467d4 100644 --- a/src/Database/Concerns/HasAbilities.php +++ b/src/Database/Concerns/HasAbilities.php @@ -13,6 +13,8 @@ use Silber\Bouncer\Conductors\RemovesAbilities; use Silber\Bouncer\Conductors\UnforbidsAbilities; +use Illuminate\Database\Eloquent\Relations\MorphToMany; + trait HasAbilities { /** @@ -34,7 +36,7 @@ public static function bootHasAbilities() * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ - public function abilities() + public function abilities(): MorphToMany { $relation = $this->morphToMany( Models::classname(Ability::class), diff --git a/src/Database/Concerns/HasRoles.php b/src/Database/Concerns/HasRoles.php index ad13ce1c..47c45dac 100644 --- a/src/Database/Concerns/HasRoles.php +++ b/src/Database/Concerns/HasRoles.php @@ -12,6 +12,8 @@ use Silber\Bouncer\Conductors\RemovesRoles; use Silber\Bouncer\Database\Queries\Roles as RolesQuery; +use Illuminate\Database\Eloquent\Relations\MorphToMany; + trait HasRoles { /** @@ -33,7 +35,7 @@ public static function bootHasRoles() * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ - public function roles() + public function roles(): MorphToMany { $relation = $this->morphToMany( Models::classname(Role::class), diff --git a/src/Database/Concerns/IsAbility.php b/src/Database/Concerns/IsAbility.php index 45944a25..d01a46c9 100644 --- a/src/Database/Concerns/IsAbility.php +++ b/src/Database/Concerns/IsAbility.php @@ -11,6 +11,8 @@ use Silber\Bouncer\Database\Scope\TenantScope; use Silber\Bouncer\Database\Queries\AbilitiesForModel; +use Illuminate\Database\Eloquent\Relations\MorphToMany; + trait IsAbility { /** @@ -147,7 +149,7 @@ public static function makeForModel($model, $attributes) * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ - public function roles() + public function roles(): MorphToMany { $relation = $this->morphedByMany( Models::classname(Role::class), @@ -163,7 +165,7 @@ public function roles() * * @return \Illuminate\Database\Eloquent\Relations\MorphToMany */ - public function users() + public function users(): MorphToMany { $relation = $this->morphedByMany( Models::classname(User::class), diff --git a/src/Database/Concerns/IsRole.php b/src/Database/Concerns/IsRole.php index c4d839f2..18a84bee 100644 --- a/src/Database/Concerns/IsRole.php +++ b/src/Database/Concerns/IsRole.php @@ -13,6 +13,7 @@ use InvalidArgumentException; use Illuminate\Support\Collection; use Illuminate\Database\Eloquent\Model; +use Illuminate\Database\Eloquent\Relations\MorphToMany; trait IsRole { @@ -43,9 +44,9 @@ public static function bootIsRole() /** * The users relationship. * - * @return \Illuminate\Database\Eloquent\Relations\MorphedByMany + * @return \Illuminate\Database\Eloquent\Relations\MorphedToMany */ - public function users() + public function users(): MorphToMany { $relation = $this->morphedByMany( Models::classname(User::class),