PHP Трейт Silber\Bouncer\Database\HasRoles

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

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

Метод Описание
assign ( Role | string $role ) Assign the given role to the model.
isA ( string $role ) : boolean Check if the model has any of the given roles.
isAll ( string $role ) : boolean Check if the model has all of the given roles.
isAn ( string $role ) : boolean Check if the model has any of the given roles.
isNot ( string $role ) : boolean Check if the model has none of the given roles.
isNotA ( string $role ) : boolean Check if the model has none of the given roles.
isNotAn ( string $role ) : boolean Check if the model has none of the given roles.
retract ( Role | string $role ) Retract the given role from the model.
roles ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany The roles relationship.
scopeWhereIs ( Builder $query, string $role ) : void Constrain the given query by the provided role.
scopeWhereIsAll ( Builder $query, string $role ) : void Constrain the given query by all provided roles.

Защищенные методы

Метод Описание
getClipboardInstance ( ) : Clipboard Get an instance of the bouncer's clipboard.

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

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

Assign the given role to the model.
public assign ( Role | string $role )
$role Role | string

getClipboardInstance() защищенный Метод

Get an instance of the bouncer's clipboard.
protected getClipboardInstance ( ) : Clipboard
Результат Silber\Bouncer\Clipboard

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

Alias for the "isAn" method.
public isA ( string $role ) : boolean
$role string
Результат boolean

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

Check if the model has all of the given roles.
public isAll ( string $role ) : boolean
$role string
Результат boolean

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

Check if the model has any of the given roles.
public isAn ( string $role ) : boolean
$role string
Результат boolean

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

Alias for the "isNotAn" method.
public isNot ( string $role ) : boolean
$role string
Результат boolean

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

Alias for the "isNotAn" method.
public isNotA ( string $role ) : boolean
$role string
Результат boolean

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

Check if the model has none of the given roles.
public isNotAn ( string $role ) : boolean
$role string
Результат boolean

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

Retract the given role from the model.
public retract ( Role | string $role )
$role Role | string

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

The roles relationship.
public roles ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany
Результат Illuminate\Database\Eloquent\Relations\MorphToMany

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

Constrain the given query by the provided role.
public scopeWhereIs ( Builder $query, string $role ) : void
$query Illuminate\Database\Eloquent\Builder
$role string
Результат void

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

Constrain the given query by all provided roles.
public scopeWhereIsAll ( Builder $query, string $role ) : void
$query Illuminate\Database\Eloquent\Builder
$role string
Результат void