Property | Type | Description | |
---|---|---|---|
$app | Illuminate\Foundation\Application | Laravel application |
Method | Description | |
---|---|---|
__construct ( Illuminate\Foundation\Application $app ) : void | Create a new confide instance. | |
ability ( array | string $roles, array | string $permissions, $group, array $options = [] ) : boolean | Check if the current user has a role or permission by its name | |
can ( string $permission, $group = null, $requireAll = false ) : boolean | Check if the current user has a permission by its name | |
hasRole ( $role, $group = null, $requireAll = false ) : boolean | Checks if the current user has a role by its name | |
routeNeedsPermission ( string $route, array | string $permissions, mixed $result = null, boolean $requireAll = true ) : mixed | Filters a route for a permission or set of permissions. | |
routeNeedsRole ( string $route, array | string $roles, mixed $result = null, boolean $requireAll = true ) : mixed | Filters a route for a role or set of roles. | |
routeNeedsRoleOrPermission ( string $route, array | string $roles, array | string $permissions, mixed $result = null, boolean $requireAll = false ) : void | Filters a route for role(s) and/or permission(s). | |
user ( ) : Illuminate\Auth\UserInterface | null | Get the currently authenticated user or null. |
public __construct ( Illuminate\Foundation\Application $app ) : void | ||
$app | Illuminate\Foundation\Application | |
return | void |
public routeNeedsPermission ( string $route, array | string $permissions, mixed $result = null, boolean $requireAll = true ) : mixed | ||
$route | string | Route pattern. i.e: "admin/*" |
$permissions | array | string | The permission(s) needed |
$result | mixed | i.e: Redirect::to('/') |
$requireAll | boolean | User must have all permissions |
return | mixed |
public routeNeedsRole ( string $route, array | string $roles, mixed $result = null, boolean $requireAll = true ) : mixed | ||
$route | string | Route pattern. i.e: "admin/*" |
$roles | array | string | The role(s) needed |
$result | mixed | i.e: Redirect::to('/') |
$requireAll | boolean | User must have all roles |
return | mixed |
public routeNeedsRoleOrPermission ( string $route, array | string $roles, array | string $permissions, mixed $result = null, boolean $requireAll = false ) : void | ||
$route | string | Route pattern. i.e: "admin/*" |
$roles | array | string | The role(s) needed |
$permissions | array | string | The permission(s) needed |
$result | mixed | i.e: Redirect::to('/') |
$requireAll | boolean | User must have all roles and permissions |
return | void |