Skip to content

cardentey/filament-spatie-roles-permissions

 
 

Repository files navigation

Screenshot

image

Description

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 reksmey/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')
    ...
    ...
])

Advance Usage

You can publish permissions seeders in additional permissions. Sometimes you may add more action such as download-pdf, export, etc.

php artisan vendor:publish --tag=role-permission-seeds

Then

php artisan db:seeder --class=RolesAndPermissionsSeeder

Hope you enjoy it ❤️

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.

About

Plug and Play filament roles and permissions

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%