Skip to content

Commit 0680e7c

Browse files
authored
Merge pull request #2748 from erikn69/patch-52
Fix GuardDoesNotMatch should accept collection
2 parents bb4c60b + 7cd173b commit 0680e7c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Models/Role.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function hasPermissionTo($permission, ?string $guardName = null): bool
185185
$permission = $this->filterPermission($permission, $guardName);
186186

187187
if (! $this->getGuardNames()->contains($permission->guard_name)) {
188-
throw GuardDoesNotMatch::create($permission->guard_name, $guardName ?? $this->getGuardNames());
188+
throw GuardDoesNotMatch::create($permission->guard_name, $guardName ? collect([$guardName]) : $this->getGuardNames());
189189
}
190190

191191
return $this->permissions->contains($permission->getKeyName(), $permission->getKey());

0 commit comments

Comments
 (0)