Permission
class Permission extends Model (View source)
Constants
SCOPE_GLOBAL |
Constant that represents a list of permissions that belongs to the global scope. |
SCOPE_MODULE |
Constant that represents a list of permissions that belongs to the module scope. |
SCOPE_ITEM |
Constant that represents a list of permissions that belongs to the module item scope. |
Properties
protected | $fillable | ||
protected | $appends |
Methods
No description
Return an array of permission names that belongs to a certain scope (global, module or item).
Retrieve the list of modules that permissions can be applied to.
Retrieve a collection of items that belongs to keyed by permissionable module names.
Get the parent permissionable model (one of the permissionale module).
User model relationship
Role model relationship
Group model relationship
Scope a query to only include global scope permissions.
Scope a query to only include module scope permissions.
Scope a query to only include module item scope permissions.
Scope a query to only include permissions related to an item.
Scope a query to only include permissions related to a Twill module.
Scope a query to only include permissions related to a model.
Get the permissionable module type of current permission
Details
__construct(array $attributes = [])
No description
static string[]|void
available(string $scope)
Return an array of permission names that belongs to a certain scope (global, module or item).
static Collection
permissionableModules()
Retrieve the list of modules that permissions can be applied to.
static Collection
permissionableParentModuleItems()
Retrieve a collection of items that belongs to keyed by permissionable module names.
MorphTo
permissionable()
Get the parent permissionable model (one of the permissionale module).
BelongsToMany
users()
User model relationship
BelongsToMany
roles()
Role model relationship
BelongsToMany
groups()
Group model relationship
Builder
scopeGlobal(Builder $query)
Scope a query to only include global scope permissions.
Builder
scopeModule(Builder $query)
Scope a query to only include module scope permissions.
Builder
scopeModuleItem(Builder $query)
Scope a query to only include module item scope permissions.
Builder
scopeOfItem(Builder $query, Model $item)
Scope a query to only include permissions related to an item.
Builder
scopeOfModuleName(Builder $query, string $moduleName)
Scope a query to only include permissions related to a Twill module.
Builder
scopeOfModel(Builder $query, string $model)
Scope a query to only include permissions related to a model.
string
getPermissionableModuleAttribute()
Get the permissionable module type of current permission