ewald1976 / filament-spatie-roles-permissions
forked from Althinect/filament-spatie-roles-permissions
Requires
- php: ^7.4|^8.0
- filament/filament: ^2.0
- spatie/laravel-permission: ^5.4
Requires (Dev)
- orchestra/testbench: ^6.0
- phpunit/phpunit: ^9.0
README
This plugin is built on top of Spatie's Permission package.
Installation
You can install the package via composer:
composer require ewald1976/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.
Usage
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.
Security
If you discover any security related issues, please create an issue.
Credits
License
The MIT License (MIT). Please see License File for more information.
Laravel Package Boilerplate
This package was generated using the Laravel Package Boilerplate.