Skip to content

Commit 8885c35

Browse files
committed
Support array of abilities in Laravel can helper
1 parent e7c87c7 commit 8885c35

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Laravel/functions.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ function authenticated(): Closure
5656
return fn() => Auth::check();
5757
}
5858

59-
function can(string $ability, ...$args): Closure
59+
function can(string|array $ability, ...$args): Closure
6060
{
6161
return function ($arg) use ($ability, $args) {
6262
if ($arg instanceof Model && !count($args)) {
6363
$args = [$arg];
6464
}
6565

66-
return Gate::allows($ability, $args);
66+
return Gate::any($ability, $args);
6767
};
6868
}

0 commit comments

Comments
 (0)