Role handling for Laravel
This package allows you to manage and assign user roles.
This package can be used in Laravel 6.0 or higher.
You can install the package via composer:
composer require macsidigital/laravel-roles
You can either publish the migration and config files separatly or use our helpful install command
The install function
php artisan roles:install
You must publish the migration with:
php artisan vendor:publish --tag="roles-migrations"
After the migration has been published you can create the db tables by running the migrations:
php artisan migrate
You can publish the config file with:
php artisan vendor:publish --tag="roles-config"
Once installed you can do stuff like this:
$user->assignRole('writer'); $user->hasRole('writer'); $user->removeRole('writer');
Every guard will have its own set of roles that can be assigned to the guard's users.
 Build out some proper documentation
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security-related issues, please email firstname.lastname@example.org instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.