Method | Description | |
---|---|---|
ability ( string | array $roles, string | array $permissions, string | boolean $group = null, array $options = [] ) : array | boolean | Checks role(s) and permission(s). | |
attachPermission ( mixed $permission ) | Alias to eloquent many-to-many relation's attach() method. | |
attachPermissions ( mixed $permissions ) | Attach multiple permissions to a user | |
attachRole ( mixed $role, string $group = null ) | Alias to eloquent many-to-many relation's attach() method. | |
attachRoles ( mixed $roles, string $group = null ) | Attach multiple roles to a user | |
can ( string | array $permission, string | boolean $group = null, boolean $requireAll = false ) : boolean | Check if user has a permission by its name. | |
detachPermission ( mixed $permission ) | Alias to eloquent many-to-many relation's detach() method. | |
detachPermissions ( mixed $permissions ) | Detach multiple permissions from a user | |
detachRole ( mixed $role, string $group = null ) | Alias to eloquent many-to-many relation's detach() method. | |
detachRoles ( mixed $roles, string $group = null ) | Detach multiple roles from a user | |
hasRole ( string | array $name, string | boolean $group = null, boolean $requireAll = false ) : boolean | Checks if the user has a role by its name. | |
permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany | Many-to-Many relations with Role. | |
roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany | Many-to-Many relations with Role. |
public ability ( string | array $roles, string | array $permissions, string | boolean $group = null, array $options = [] ) : array | boolean | ||
$roles | string | array | Array of roles or comma separated string |
$permissions | string | array | Array of permissions or comma separated string. |
$group | string | boolean | Group or options value |
$options | array | validate_all (true|false) or return_type (boolean|array|both) |
return | array | boolean |
public attachPermission ( mixed $permission ) | ||
$permission | mixed |
public attachPermissions ( mixed $permissions ) | ||
$permissions | mixed |
public attachRole ( mixed $role, string $group = null ) | ||
$role | mixed | |
$group | string |
public attachRoles ( mixed $roles, string $group = null ) | ||
$roles | mixed | |
$group | string |
public can ( string | array $permission, string | boolean $group = null, boolean $requireAll = false ) : boolean | ||
$permission | string | array | Permission string or array of permissions. |
$group | string | boolean | Group or requireAll value |
$requireAll | boolean | All permissions in the array are required. |
return | boolean |
public detachPermission ( mixed $permission ) | ||
$permission | mixed |
public detachPermissions ( mixed $permissions ) | ||
$permissions | mixed |
public detachRole ( mixed $role, string $group = null ) | ||
$role | mixed | |
$group | string |
public detachRoles ( mixed $roles, string $group = null ) | ||
$roles | mixed | |
$group | string |
public permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany | ||
return | Illuminate\Database\Eloquent\Relations\BelongsToMany |
public roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany | ||
return | Illuminate\Database\Eloquent\Relations\BelongsToMany |