This plugin is built on top of Spatie's Permission package.
You can install the package via composer:
composer require althinect/filament-spatie-roles-permissions
Since the package depends on Spatie's Permission package. You have to publish the migrations by running:
php artisan vendor:publish --provider="Spatie\Permission\PermissionServiceProvider"
Now you should add any other configurations needed for the Spatie-Permission package.
You can publish the config file of the package with:
php artisan vendor:publish --tag="filament-spatie-roles-permissions-config"
You can add this to your form method in your UserResource
return $form->schema([
...
BelongsToManyMultiSelect::make('roles')->relationship('roles', 'name')
])
In addition to the field added to the UserResource. There will be 2 Resources published under Roles and Permissions. You can use these resources manage roles and permissions.
If you discover any security related issues, please create an issue.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.