PHP Trait app\HasRoles

Afficher le fichier Open project: appzcoder/laravel-admin

Méthodes publiques

Méthode Description
assignRole ( string $role ) : mixed Assign the given role to the user.
hasPermission ( Permission $permission ) : boolean Determine if the user may perform the given permission.
hasRole ( mixed $role ) : boolean Determine if the user has the given role.
roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany A user may have multiple roles.

Method Details

assignRole() public méthode

Assign the given role to the user.
public assignRole ( string $role ) : mixed
$role string
Résultat mixed

hasPermission() public méthode

Determine if the user may perform the given permission.
public hasPermission ( Permission $permission ) : boolean
$permission Permission
Résultat boolean

hasRole() public méthode

Determine if the user has the given role.
public hasRole ( mixed $role ) : boolean
$role mixed
Résultat boolean

roles() public méthode

A user may have multiple roles.
public roles ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
Résultat Illuminate\Database\Eloquent\Relations\BelongsToMany