PHP Class Gate, someline-starter

Inheritance: extends Illuminate\Support\Facades\Gate
Afficher le fichier Open project: someline/someline-starter Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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

allows() public static méthode

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
Résultat boolean

authorize() public static méthode

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
Résultat Illuminate\Auth\Access\Response

before() public static méthode

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

check() public static méthode

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
Résultat boolean

define() public static méthode

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

denies() public static méthode

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
Résultat boolean

forUser() public static méthode

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

getPolicyFor() public static méthode

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

has() public static méthode

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

policy() public static méthode

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

resolvePolicy() public static méthode

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