abdelhammied/filament-laravel-permission

A Laravel Filament package to manage user permissions and roles in filament with spatie/laravel-permission

dev-main 2025-02-03 21:01 UTC

This package is auto-updated.

Last update: 2025-03-03 21:14:07 UTC


README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

A Laravel Filament package to manage user permissions and roles in filament with spatie/laravel-permission

Installation

You can install the package via composer:

composer require abdelhammied/filament-laravel-permission

You can publish the config file with:

php artisan vendor:publish --tag="filament-laravel-permission-config"

This is the contents of the published config file:

return [
    'styling' => [
        'show_form_permissions_header_actions' => true,
        'permissions_columns' => 3,
        'permissions_collapsible' => false,
        'permissions_collapsed' => false,
    ],

    'guards' => [
        'use_single_default_guard' => false,
        'default_guard' => 'nova',

        'options' => [
            'web' => 'Web',
            'api' => 'API',
            'nova' => 'Nova',
        ],
    ],
];

Usage

You need to register the plugin in the panel first

$panel->plugin(
    new \Abdelhammied\FilamentLaravelPermission\FilamentLaravelPermissionPlugin()
)

then use the facade navigation function to add the plugin to your navigation

\Abdelhammied\FilamentLaravelPermission\Facades\FilamentLaravelPermissionFacade::navigationGroup()

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.