PHP 트레잇 Laratrust\Traits\LaratrustRoleTrait

파일 보기 프로젝트 열기: santigarcor/laratrust

공개 메소드들

메소드 설명
attachPermission ( object | array $permission ) : void Attach permission to current role.
attachPermissions ( mixed $permissions ) : void Attach multiple permissions to current role.
bootLaratrustRoleTrait ( ) : void | boolean Boot the role model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the role model uses soft deletes.
cachedPermissions ( ) : Illuminate\Database\Eloquent\Collection Big block of caching functionality
detachPermission ( object | array $permission ) : void Detach permission from current role.
detachPermissions ( mixed $permissions ) : void Detach multiple permissions from current role
flushCache ( ) : void Flush the role's cache
hasPermission ( string | array $name, boolean $requireAll = false ) : boolean Checks if the role has a permission by its name.
permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany Many-to-Many relations with the permission model.
savePermissions ( mixed $inputPermissions ) : array Save the inputted permissions.
users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany Many-to-Many relations with the user model.

메소드 상세

attachPermission() 공개 메소드

Attach permission to current role.
public attachPermission ( object | array $permission ) : void
$permission object | array
리턴 void

attachPermissions() 공개 메소드

Attach multiple permissions to current role.
public attachPermissions ( mixed $permissions ) : void
$permissions mixed
리턴 void

bootLaratrustRoleTrait() 공개 정적인 메소드

Boot the role model Attach event listener to remove the many-to-many records when trying to delete Will NOT delete any records if the role model uses soft deletes.
public static bootLaratrustRoleTrait ( ) : void | boolean
리턴 void | boolean

cachedPermissions() 공개 메소드

Big block of caching functionality
public cachedPermissions ( ) : Illuminate\Database\Eloquent\Collection
리턴 Illuminate\Database\Eloquent\Collection

detachPermission() 공개 메소드

Detach permission from current role.
public detachPermission ( object | array $permission ) : void
$permission object | array
리턴 void

detachPermissions() 공개 메소드

Detach multiple permissions from current role
public detachPermissions ( mixed $permissions ) : void
$permissions mixed
리턴 void

flushCache() 공개 메소드

Flush the role's cache
public flushCache ( ) : void
리턴 void

hasPermission() 공개 메소드

Checks if the role has a permission by its name.
public hasPermission ( string | array $name, boolean $requireAll = false ) : boolean
$name string | array Permission name or array of permission names.
$requireAll boolean All permissions in the array are required.
리턴 boolean

permissions() 공개 메소드

Many-to-Many relations with the permission model.
public permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
리턴 Illuminate\Database\Eloquent\Relations\BelongsToMany

savePermissions() 공개 메소드

Save the inputted permissions.
public savePermissions ( mixed $inputPermissions ) : array
$inputPermissions mixed
리턴 array

users() 공개 메소드

Many-to-Many relations with the user model.
public users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
리턴 Illuminate\Database\Eloquent\Relations\BelongsToMany