PHP Class Caffeinated\Shinobi\Models\Role

Inheritance: extends Illuminate\Database\Eloquent\Model
Afficher le fichier Open project: caffeinated/shinobi Class Usage Examples

Protected Properties

Свойство Type Description
$fillable array The attributes that are fillable via mass assignment.
$table string The database table used by the model.
$tag string The cache tag used by the model.

Méthodes publiques

Méthode Description
assignPermission ( integer $permissionId = null ) : boolean Assigns the given permission to the role.
can ( string $permission ) : boolean Checks if the role has the given permission.
canAtLeast ( array $permission = [] ) : boolean Check if the role has at least one of the given permissions.
flushPermissionCache ( ) : void Flush the permission cache repository.
getPermissions ( ) : array Get permission slugs assigned to role.
permissions ( ) : Model Roles can have many permissions.
revokeAllPermissions ( ) : boolean Revokes all permissions from the role.
revokePermission ( integer $permissionId = '' ) : boolean Revokes the given permission from the role.
syncPermissions ( array $permissionIds = [] ) : boolean Syncs the given permission(s) with the role.
users ( ) : Model Roles can belong to many users.

Method Details

assignPermission() public méthode

Assigns the given permission to the role.
public assignPermission ( integer $permissionId = null ) : boolean
$permissionId integer
Résultat boolean

can() public méthode

Checks if the role has the given permission.
public can ( string $permission ) : boolean
$permission string
Résultat boolean

canAtLeast() public méthode

Check if the role has at least one of the given permissions.
public canAtLeast ( array $permission = [] ) : boolean
$permission array
Résultat boolean

flushPermissionCache() public méthode

Flush the permission cache repository.
public flushPermissionCache ( ) : void
Résultat void

getPermissions() public méthode

Get permission slugs assigned to role.
public getPermissions ( ) : array
Résultat array

permissions() public méthode

Roles can have many permissions.
public permissions ( ) : Model
Résultat Illuminate\Database\Eloquent\Model

revokeAllPermissions() public méthode

Revokes all permissions from the role.
public revokeAllPermissions ( ) : boolean
Résultat boolean

revokePermission() public méthode

Revokes the given permission from the role.
public revokePermission ( integer $permissionId = '' ) : boolean
$permissionId integer
Résultat boolean

syncPermissions() public méthode

Syncs the given permission(s) with the role.
public syncPermissions ( array $permissionIds = [] ) : boolean
$permissionIds array
Résultat boolean

users() public méthode

Roles can belong to many users.
public users ( ) : Model
Résultat Illuminate\Database\Eloquent\Model

Property Details

$fillable protected_oe property

The attributes that are fillable via mass assignment.
protected array $fillable
Résultat array

$table protected_oe property

The database table used by the model.
protected string $table
Résultat string

$tag protected_oe property

The cache tag used by the model.
protected string $tag
Résultat string