ewald1976/filament-spatie-roles-permissions

forked from Althinect/filament-spatie-roles-permissions

dev-main 2022-12-01 15:52 UTC

This package is auto-updated.

Last update: 2024-04-29 04:53:55 UTC


README

Latest Version on Packagist Total Downloads GitHub Actions

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.