We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
can
1 parent e7c87c7 commit 8885c35Copy full SHA for 8885c35
src/Laravel/functions.php
@@ -56,13 +56,13 @@ function authenticated(): Closure
56
return fn() => Auth::check();
57
}
58
59
-function can(string $ability, ...$args): Closure
+function can(string|array $ability, ...$args): Closure
60
{
61
return function ($arg) use ($ability, $args) {
62
if ($arg instanceof Model && !count($args)) {
63
$args = [$arg];
64
65
66
- return Gate::allows($ability, $args);
+ return Gate::any($ability, $args);
67
};
68
0 commit comments