PHP 트레잇 Silber\Bouncer\Database\HasRoles

파일 보기 프로젝트 열기: JosephSilber/bouncer

공개 메소드들

메소드 설명
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