PHP Класс Gate, someline-starter

Наследование: extends Illuminate\Support\Facades\Gate
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Описание методов

after() публичный статический Метод

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

allows() публичный статический Метод

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
Результат boolean

authorize() публичный статический Метод

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
Результат Illuminate\Auth\Access\Response

before() публичный статический Метод

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

check() публичный статический Метод

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
Результат boolean

define() публичный статический Метод

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

denies() публичный статический Метод

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
Результат boolean

forUser() публичный статический Метод

Get a gate instance for the given user.
public static forUser ( Illuminate\Contracts\Auth\Authenticatable | mixed $user ) : static
$user Illuminate\Contracts\Auth\Authenticatable | mixed
Результат static

getPolicyFor() публичный статический Метод

Get a policy instance for a given class.
public static getPolicyFor ( object | string $class ) : mixed
$class object | string
Результат mixed

has() публичный статический Метод

Determine if a given ability has been defined.
public static has ( string $ability ) : boolean
$ability string
Результат boolean

policy() публичный статический Метод

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

resolvePolicy() публичный статический Метод

Build a policy class instance of the given type.
public static resolvePolicy ( object | string $class ) : mixed
$class object | string
Результат mixed