Laravel’s authorization features are available in Models which implement the
Illuminate\Foundation\Auth\Access\Authorizable trait. In a fresh Laravel app this is done in
\App\User by extending
If you are creating your own, or additional, User models and wish Authorization features to be available on it, including Roles and Permissions with this package, you need to implement
Illuminate\Foundation\Auth\Access\Authorizable in one of those ways as well.
If you are extending or replacing the role/permission models, you will need to specify your new models in the configuration.
First be sure that you’ve published the configuration file (see the Installation instructions), and edit it to update the
models.permission values to point to your new models.
Note the following requirements when extending/replacing the models:
If you need to EXTEND the existing
Permission models note that:
Rolemodel needs to extend the
Permissionmodel needs to extend the
If you need to REPLACE the existing
Permission models you need to keep the
following things in mind:
Rolemodel needs to implement the
Permissionmodel needs to implement the