PHP Класс Caffeinated\Shinobi\Models\Role

Наследование: extends Illuminate\Database\Eloquent\Model
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$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.

Открытые методы

Метод Описание
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.

Описание методов

assignPermission() публичный Метод

Assigns the given permission to the role.
public assignPermission ( integer $permissionId = null ) : boolean
$permissionId integer
Результат boolean

can() публичный Метод

Checks if the role has the given permission.
public can ( string $permission ) : boolean
$permission string
Результат boolean

canAtLeast() публичный Метод

Check if the role has at least one of the given permissions.
public canAtLeast ( array $permission = [] ) : boolean
$permission array
Результат boolean

flushPermissionCache() публичный Метод

Flush the permission cache repository.
public flushPermissionCache ( ) : void
Результат void

getPermissions() публичный Метод

Get permission slugs assigned to role.
public getPermissions ( ) : array
Результат array

permissions() публичный Метод

Roles can have many permissions.
public permissions ( ) : Model
Результат Illuminate\Database\Eloquent\Model

revokeAllPermissions() публичный Метод

Revokes all permissions from the role.
public revokeAllPermissions ( ) : boolean
Результат boolean

revokePermission() публичный Метод

Revokes the given permission from the role.
public revokePermission ( integer $permissionId = '' ) : boolean
$permissionId integer
Результат boolean

syncPermissions() публичный Метод

Syncs the given permission(s) with the role.
public syncPermissions ( array $permissionIds = [] ) : boolean
$permissionIds array
Результат boolean

users() публичный Метод

Roles can belong to many users.
public users ( ) : Model
Результат Illuminate\Database\Eloquent\Model

Описание свойств

$fillable защищенное свойство

The attributes that are fillable via mass assignment.
protected array $fillable
Результат array

$table защищенное свойство

The database table used by the model.
protected string $table
Результат string

$tag защищенное свойство

The cache tag used by the model.
protected string $tag
Результат string