owowagency/laravel-has-users-with-roles
Laravel: Has Users With Roles Trait
A trait for Laravel models which have many users with roles.
Installation
Via Composer in an already running project:
$ composer require owowagency/laravel-has-users-with-roles
$ composer update
Usage
- Implement the trait in the model which will have many users with roles.
- *Override the
getUsersPivotClassmethod to return the desired pivot model class. By default it returnsPivot::class. - *Configure the
user_model_pathconfig value to tell the trait where theUsermodel is. By default the path isApp\Models\User.
* = Optional
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Related Packages
jeremykenedy/laravel-roles
A Powerful package for handling roles and permissions in Laravel. Supports Larav...
890,665
1,049
kodeine/laravel-acl
Light-weight role-based permissions for Laravel 5 built in Auth system.
363,834
774