PHP Interface Spatie\Permission\Contracts\Role

Afficher le fichier Open project: spatie/laravel-permission

Méthodes publiques

Méthode Description
findByName ( string $name ) Find a role by its name.
hasPermissionTo ( string | Spatie\Permission\Contracts\Permission $permission ) : boolean Determine if the user may perform the given permission.
permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany A role may be given various permissions.
users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany A role may be assigned to various users.

Method Details

findByName() public static méthode

Find a role by its name.
public static findByName ( string $name )
$name string

hasPermissionTo() public méthode

Determine if the user may perform the given permission.
public hasPermissionTo ( string | Spatie\Permission\Contracts\Permission $permission ) : boolean
$permission string | Spatie\Permission\Contracts\Permission
Résultat boolean

permissions() public méthode

A role may be given various permissions.
public permissions ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
Résultat Illuminate\Database\Eloquent\Relations\BelongsToMany

users() public méthode

A role may be assigned to various users.
public users ( ) : Illuminate\Database\Eloquent\Relations\BelongsToMany
Résultat Illuminate\Database\Eloquent\Relations\BelongsToMany