Skip to content

Commit

Permalink
Fix phpstan
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 authored Jun 21, 2024
1 parent 41977f3 commit d2c20ec
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Traits/HasRoles.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ public function hasRole($roles, ?string $guard = null): bool
return $this->roles
->when($guard, fn ($q) => $q->where('guard_name', $guard))
->contains(function ($role) use ($roles) {
/** @var Role $role */
if ($role->name instanceof \BackedEnum) {
return $role->name->value == $roles;
}
Expand Down

0 comments on commit d2c20ec

Please sign in to comment.