Gate

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.

$this after(callable $callback)

Register a callback to run after 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.

Response authorize(string $ability, array|mixed $arguments = array())

Determine if the given ability should be granted for the current user.

mixed getPolicyFor(object|string $class)

Get a policy instance for a given class.

Gate forUser(Authenticatable|mixed $user)

Get a guard instance for the given user.

doc_Laravel
2016-11-02 16:19:38
Comments
Leave a Comment

Please login to continue.