Skip to content

4.2. Authorization (Roles)

John edited this page Apr 18, 2019 · 2 revisions

Starting with version 2.0, roles can be added on admin account but their application is inbuilt.

Default roles

  • admin
  • manager
  • staff
  • member
  • volunteer
  • accountant

Usage

Blade templates or classes

has_role('admin')

has_role(['admin','manager'])

e.g.

@if(has_role('admin'))
    //do something with super powers
@endif

Middleware

$this->middleware('role:admin');

$this->middleware('role:admin,manager');
Clone this wiki locally