laravel-permission

Official

https://github.com/spatie/laravel-permission

Doc

https://docs.spatie.be/laravel-permission/v3/basic-usage/role-permissions/

Model User

Config “Super Admin” in AuthServiceProvider.php

Controller and related functions

Add useful function in model User

Useful functions:

Check permission

https://docs.spatie.be/laravel-permission/v3/basic-usage/direct-permissions/

Use middeware

Trait for controller to use

Bugs

/vendor/spatie/laravel-permission/src/Traits/HasPermissions.php
Line #285