PHP Class Caffeinated\Shinobi\Models\Role

Inheritance: extends Illuminate\Database\Eloquent\Model
Datei anzeigen Open project: caffeinated/shinobi Class Usage Examples

Protected Properties

Property 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.

Public Methods

Method 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 method

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

can() public method

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

canAtLeast() public method

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

flushPermissionCache() public method

Flush the permission cache repository.
public flushPermissionCache ( ) : void
return void

getPermissions() public method

Get permission slugs assigned to role.
public getPermissions ( ) : array
return array

permissions() public method

Roles can have many permissions.
public permissions ( ) : Model
return Illuminate\Database\Eloquent\Model

revokeAllPermissions() public method

Revokes all permissions from the role.
public revokeAllPermissions ( ) : boolean
return boolean

revokePermission() public method

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

syncPermissions() public method

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

users() public method

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

Property Details

$fillable protected_oe property

The attributes that are fillable via mass assignment.
protected array $fillable
return array

$table protected_oe property

The database table used by the model.
protected string $table
return string

$tag protected_oe property

The cache tag used by the model.
protected string $tag
return string