PHP Class Gate, someline-starter

Inheritance: extends Illuminate\Support\Facades\Gate
Show file Open project: someline/someline-starter Class Usage Examples

Public Methods

Method Description
after ( callable $callback ) Register a callback to run after all Gate checks.
allows ( string $ability, array | mixed $arguments = [] ) : boolean Determine if the given ability should be granted for the current user.
authorize ( string $ability, array | mixed $arguments = [] ) : Illuminate\Auth\Access\Response Determine if the given ability should be granted for the current user.
before ( callable $callback ) Register a callback to run before all Gate checks.
check ( string $ability, array | mixed $arguments = [] ) : boolean Determine if the given ability should be granted for the current user.
define ( string $ability, callable | string $callback ) Define a new ability.
denies ( string $ability, array | mixed $arguments = [] ) : boolean Determine if the given ability should be denied for the current user.
forUser ( Illuminate\Contracts\Auth\Authenticatable | mixed $user ) : static Get a gate instance for the given user.
getPolicyFor ( object | string $class ) : mixed Get a policy instance for a given class.
has ( string $ability ) : boolean Determine if a given ability has been defined.
policy ( string $class, string $policy ) Define a policy class for a given class type.
resolvePolicy ( object | string $class ) : mixed Build a policy class instance of the given type.

Method Details

after() public static method

Register a callback to run after all Gate checks.
public static after ( callable $callback )
$callback callable

allows() public static method

Determine if the given ability should be granted for the current user.
public static allows ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
return boolean

authorize() public static method

Determine if the given ability should be granted for the current user.
public static authorize ( string $ability, array | mixed $arguments = [] ) : Illuminate\Auth\Access\Response
$ability string
$arguments array | mixed
return Illuminate\Auth\Access\Response

before() public static method

Register a callback to run before all Gate checks.
public static before ( callable $callback )
$callback callable

check() public static method

Determine if the given ability should be granted for the current user.
public static check ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
return boolean

define() public static method

Define a new ability.
public static define ( string $ability, callable | string $callback )
$ability string
$callback callable | string

denies() public static method

Determine if the given ability should be denied for the current user.
public static denies ( string $ability, array | mixed $arguments = [] ) : boolean
$ability string
$arguments array | mixed
return boolean

forUser() public static method

Get a gate instance for the given user.
public static forUser ( Illuminate\Contracts\Auth\Authenticatable | mixed $user ) : static
$user Illuminate\Contracts\Auth\Authenticatable | mixed
return static

getPolicyFor() public static method

Get a policy instance for a given class.
public static getPolicyFor ( object | string $class ) : mixed
$class object | string
return mixed

has() public static method

Determine if a given ability has been defined.
public static has ( string $ability ) : boolean
$ability string
return boolean

policy() public static method

Define a policy class for a given class type.
public static policy ( string $class, string $policy )
$class string
$policy string

resolvePolicy() public static method

Build a policy class instance of the given type.
public static resolvePolicy ( object | string $class ) : mixed
$class object | string
return mixed