PHP Interface Spatie\Permission\Contracts\Role

Mostra file Open project: spatie/laravel-permission

Public Methods

Method 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 method

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

hasPermissionTo() public method

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

permissions() public method

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

users() public method

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