Gate
interface Gate
Methods
Determine if a given ability has been defined.
Define a new ability.
Define a policy class for a given class type.
Register a callback to run before all Gate checks.
Register a callback to run after all Gate checks.
Determine if the given ability should be granted for the current user.
Determine if the given ability should be denied for the current user.
Determine if the given ability should be granted.
Determine if the given ability should be granted for the current user.
Get a policy instance for a given class.
Details
at line 13
bool
has(string $ability)
Determine if a given ability has been defined.
at line 22
$this
define(string $ability, callable|string $callback)
Define a new ability.
at line 31
$this
policy(string $class, string $policy)
Define a policy class for a given class type.
at line 39
$this
before(callable $callback)
Register a callback to run before all Gate checks.
at line 47
$this
after(callable $callback)
Register a callback to run after all Gate checks.
at line 56
bool
allows(string $ability, array|mixed $arguments = [])
Determine if the given ability should be granted for the current user.
at line 65
bool
denies(string $ability, array|mixed $arguments = [])
Determine if the given ability should be denied for the current user.
at line 74
bool
check(string $ability, array|mixed $arguments = [])
Determine if the given ability should be granted.
at line 85
Response
authorize(string $ability, array|mixed $arguments = [])
Determine if the given ability should be granted for the current user.
at line 95
mixed
getPolicyFor(object|string $class)
Get a policy instance for a given class.
at line 103
Gate
forUser(Authenticatable|mixed $user)
Get a guard instance for the given user.