PHP Trait Silber\Bouncer\Database\HasRoles

Afficher le fichier Open project: JosephSilber/bouncer

Méthodes publiques

Méthode Description
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.

Méthodes protégées

Méthode Description
getClipboardInstance ( ) : Clipboard Get an instance of the bouncer's clipboard.

Method Details

assign() public méthode

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

getClipboardInstance() protected méthode

Get an instance of the bouncer's clipboard.
protected getClipboardInstance ( ) : Clipboard
Résultat Silber\Bouncer\Clipboard

isA() public méthode

Alias for the "isAn" method.
public isA ( string $role ) : boolean
$role string
Résultat boolean

isAll() public méthode

Check if the model has all of the given roles.
public isAll ( string $role ) : boolean
$role string
Résultat boolean

isAn() public méthode

Check if the model has any of the given roles.
public isAn ( string $role ) : boolean
$role string
Résultat boolean

isNot() public méthode

Alias for the "isNotAn" method.
public isNot ( string $role ) : boolean
$role string
Résultat boolean

isNotA() public méthode

Alias for the "isNotAn" method.
public isNotA ( string $role ) : boolean
$role string
Résultat boolean

isNotAn() public méthode

Check if the model has none of the given roles.
public isNotAn ( string $role ) : boolean
$role string
Résultat boolean

retract() public méthode

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

roles() public méthode

The roles relationship.
public roles ( ) : Illuminate\Database\Eloquent\Relations\MorphToMany
Résultat Illuminate\Database\Eloquent\Relations\MorphToMany

scopeWhereIs() public méthode

Constrain the given query by the provided role.
public scopeWhereIs ( Builder $query, string $role ) : void
$query Illuminate\Database\Eloquent\Builder
$role string
Résultat void

scopeWhereIsAll() public méthode

Constrain the given query by all provided roles.
public scopeWhereIsAll ( Builder $query, string $role ) : void
$query Illuminate\Database\Eloquent\Builder
$role string
Résultat void