RoleΒΆ

Create a Role model inside app/Role.php using the following example:

<?php

namespace App;

use Laratrust\LaratrustRole;

class Role extends LaratrustRole
{
}

The Role model has three main attributes:

  • name β€” Unique name for the Role, used for looking up role information in the application layer. For example: “admin”, “owner”, “employee”.
  • display_name β€” Human readable name for the Role. Not necessarily unique and optional. For example: “User Administrator”, “Project Owner”, “Widget Co. Employee”.
  • description β€” A more detailed explanation of what the Role does. Also, optional.

Both display_name and description are optional; their fields are nullable in the database.