PHP Класс Laratrust\Laratrust

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$app Illuminate\Foundation\Application Laravel application

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

Метод Описание
__construct ( Illuminate\Foundation\Application $app ) : void Create a new confide instance.
ability ( array | string $roles, array | string $permissions, $group, array $options = [] ) : boolean Check if the current user has a role or permission by its name
can ( string $permission, $group = null, $requireAll = false ) : boolean Check if the current user has a permission by its name
hasRole ( $role, $group = null, $requireAll = false ) : boolean Checks if the current user has a role by its name
routeNeedsPermission ( string $route, array | string $permissions, mixed $result = null, boolean $requireAll = true ) : mixed Filters a route for a permission or set of permissions.
routeNeedsRole ( string $route, array | string $roles, mixed $result = null, boolean $requireAll = true ) : mixed Filters a route for a role or set of roles.
routeNeedsRoleOrPermission ( string $route, array | string $roles, array | string $permissions, mixed $result = null, boolean $requireAll = false ) : void Filters a route for role(s) and/or permission(s).
user ( ) : Illuminate\Auth\UserInterface | null Get the currently authenticated user or null.

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

__construct() публичный Метод

Create a new confide instance.
public __construct ( Illuminate\Foundation\Application $app ) : void
$app Illuminate\Foundation\Application
Результат void

ability() публичный Метод

Check if the current user has a role or permission by its name
public ability ( array | string $roles, array | string $permissions, $group, array $options = [] ) : boolean
$roles array | string The role(s) needed.
$permissions array | string The permission(s) needed.
$options array The Options.
Результат boolean

can() публичный Метод

Check if the current user has a permission by its name
public can ( string $permission, $group = null, $requireAll = false ) : boolean
$permission string Permission string.
Результат boolean

hasRole() публичный Метод

Checks if the current user has a role by its name
public hasRole ( $role, $group = null, $requireAll = false ) : boolean
Результат boolean

routeNeedsPermission() публичный Метод

If the third parameter is null then abort with status code 403. Otherwise the $result is returned.
public routeNeedsPermission ( string $route, array | string $permissions, mixed $result = null, boolean $requireAll = true ) : mixed
$route string Route pattern. i.e: "admin/*"
$permissions array | string The permission(s) needed
$result mixed i.e: Redirect::to('/')
$requireAll boolean User must have all permissions
Результат mixed

routeNeedsRole() публичный Метод

If the third parameter is null then abort with status code 403. Otherwise the $result is returned.
public routeNeedsRole ( string $route, array | string $roles, mixed $result = null, boolean $requireAll = true ) : mixed
$route string Route pattern. i.e: "admin/*"
$roles array | string The role(s) needed
$result mixed i.e: Redirect::to('/')
$requireAll boolean User must have all roles
Результат mixed

routeNeedsRoleOrPermission() публичный Метод

If the third parameter is null then abort with status code 403. Otherwise the $result is returned.
public routeNeedsRoleOrPermission ( string $route, array | string $roles, array | string $permissions, mixed $result = null, boolean $requireAll = false ) : void
$route string Route pattern. i.e: "admin/*"
$roles array | string The role(s) needed
$permissions array | string The permission(s) needed
$result mixed i.e: Redirect::to('/')
$requireAll boolean User must have all roles and permissions
Результат void

user() публичный Метод

Get the currently authenticated user or null.
public user ( ) : Illuminate\Auth\UserInterface | null
Результат Illuminate\Auth\UserInterface | null

Описание свойств

$app публичное свойство

Laravel application
public Application,Illuminate\Foundation $app
Результат Illuminate\Foundation\Application