Toggle navigation
Hot Examples
EN
EN
RU
DE
FR
ES
PT
IT
JP
ZH
KO
PHP
PHP
C#
Java
Go
C++
Python
JS
TS
Search
Home
Laratrust
Contracts
LaratrustUserInterface
hasRole
Laratrust\Contracts\LaratrustUserInterface::hasRole PHP Method
LaratrustUserInterface Interface Documentation
Show file
Open project: santigarcor/laratrust
hasRole()
public
method
Checks if the user has a role by its name.
public
hasRole
(
string
|
array
$name
,
string
|
boolean
$group
= null,
boolean
$requireAll
= false ) :
boolean
$name
string
|
array
Role name or array of role names.
$group
string
|
boolean
Group or requireAll value
$requireAll
boolean
All roles in the array are required.
return
boolean
public function hasRole($name, $group = null, $requireAll = false);
LaratrustUserInterface
ability
attachPermission
attachPermissions
attachRole
attachRoles
can
detachPermission
detachPermissions
detachRole
detachRoles
hasRole
permissions
roles