RbacUserContract
interface RbacUserContract
用户约束
Methods
BelongsToMany
roles()
Many-to-Many relations with Role.
bool
hasRole(string|array $name, bool $require_all = false)
Checks if the user has a role by its name.
bool
capable(string|array $permission, bool $require_all = false)
Check if user has a permission by its name.
array|bool
ability(string|array $roles, string|array $permissions, array $options = [])
Checks role(s) and permission(s).
attachRole(int|int[]|object|object[] $id)
Alias to eloquent many-to-many relation's attach() method.
detachRole(int|int[]|object|object[] $id)
Alias to eloquent many-to-many relation's detach() method.
Details
at line 19
BelongsToMany
roles()
Many-to-Many relations with Role.
at line 27
bool
hasRole(string|array $name, bool $require_all = false)
Checks if the user has a role by its name.
at line 35
bool
capable(string|array $permission, bool $require_all = false)
Check if user has a permission by its name.
at line 45
array|bool
ability(string|array $roles, string|array $permissions, array $options = [])
Checks role(s) and permission(s).
at line 51
attachRole(int|int[]|object|object[] $id)
Alias to eloquent many-to-many relation's attach() method.
at line 57
detachRole(int|int[]|object|object[] $id)
Alias to eloquent many-to-many relation's detach() method.