jrb-y / role-manager
A Role Manager for Laravel 5.*
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/jrb-y/role-manager
Requires (Dev)
- orchestra/testbench: ^3.9@dev
- phpunit/phpunit: ^8.2@dev
This package is auto-updated.
Last update: 2025-11-29 02:49:57 UTC
README
A lightweight and simple Laravel package to manage Roles.
Feel free to make some pull requests ✌️
Contents
Installation
1 - To install the pasckage:
composer require jrb-y/role-manager
2 - If you use Laravel +5.0 no need to register the Service Provider, else you need
to register it manually.
In config/app.php add the provider:
Jrb\RoleManager\RoleManagerServiceProvider::class,
3 - Publish the config file by running.
php artisan vendor:publish --tag=roles
Laravel will publish a config/roles.php configuration file.
3 - Run the migrate
⚠️ if you need to customize your models, tables and foreign keys, jump to configuration
before you run the migration.
php artisan migrate
This command will create a roles and role_user tables.
Configuration
After you publish your configuration file, you can customize it:
- Models: You can configure your Role, User and UserRole models.
- Tables: You can configure your roles, users and user_role table.
- Foreigners: You can configure your roles and users foreign keys.
Usage
To use this package you only need to use the Jrb\RoleManager\Traits\HasRole trait
in your User Model.
Documentation in construction.
Contribution
All contributions are welcomed.