Gate
interface Gate (View source)
Methods
bool
has(
string $ability)
Determine if a given ability has been defined.
$this
define(
string $ability,
callable|string $callback)
Define a new ability.
$this
policy(
string $class,
string $policy)
Define a policy class for a given class type.
$this
before(
callable $callback)
Register a callback to run before all Gate checks.
bool
allows(
string $ability,
array|mixed $arguments = array())
Determine if the given ability should be granted for the current user.
bool
denies(
string $ability,
array|mixed $arguments = array())
Determine if the given ability should be denied for the current user.
bool
check(
string $ability,
array|mixed $arguments = array())
Determine if the given ability should be granted.
Details
at line line 31
$this
policy(
string $class,
string $policy)
Define a policy class for a given class type.
at line line 39
$this
before(
callable $callback)
Register a callback to run before all Gate checks.
at line line 48
bool
allows(
string $ability,
array|mixed $arguments = array())
Determine if the given ability should be granted for the current user.
at line line 57
bool
denies(
string $ability,
array|mixed $arguments = array())
Determine if the given ability should be denied for the current user.
at line line 66
bool
check(
string $ability,
array|mixed $arguments = array())
Determine if the given ability should be granted.