- What is luilliarcec/filament-shield used for?
- It is a Laravel package that adds role and permission management to Filament admin panels. You can use it to control which users can view, create, update, or delete resources, and to restrict access to custom pages and dashboard widgets. It builds on Laravel authorization concepts and provides a UI for managing roles and permissions.
- How do I install luilliarcec/filament-shield?
- Install the package with Composer using composer require luilliarcec/filament-shield. Then run the package install command and migrations as described in the README, and publish any configuration or assets if needed. Clear caches and make sure your User model uses the required traits for roles and permissions.
- Which Laravel and Filament versions does luilliarcec/filament-shield support?
- Support depends on the package release and its Composer constraints. Check the README and Packagist for the exact Laravel and Filament versions supported by the release you plan to use. Pin a version that matches your application's Laravel and Filament major versions before installing.
- How does luilliarcec/filament-shield integrate with Laravel authorization?
- It integrates with Laravel's Gate and authorization system by mapping roles and permissions to abilities. Filament resources, pages, and widgets can then check those abilities using policies or built-in authorization methods. This helps keep permission checks consistent between Filament and the rest of your Laravel application.
- Can I restrict access to Filament resources, pages, and widgets?
- Yes. The package is designed to let you restrict Filament resources, custom pages, and dashboard widgets through roles and permissions. You assign permissions to roles and roles to users, then rely on Filament's authorization hooks to hide or block unauthorized access. Always verify both UI visibility and backend authorization.
- How do I create roles and assign permissions to users?
- Use the package's Filament UI or its underlying models to create roles and attach permissions. Then assign those roles to users through your user management flow or directly in code. The exact API follows the package's documented models and traits, so check the README for the correct class names and methods.
- Does luilliarcec/filament-shield support multiple Filament panels?
- Filament supports multiple panels, and the package is intended to work with Filament's panel authorization features. Whether permissions are shared or scoped per panel depends on your configuration and the package version. Review the README for multi-panel guidance and test each panel's access rules.
- How do I test role and permission behavior with this package?
- Write feature tests that authenticate users with different roles and assert allowed or denied access to Filament resource routes and pages. Use Laravel's testing helpers and, where available, Filament's testing utilities. Also test the backend authorization, not only whether buttons are hidden in the UI.
- Is luilliarcec/filament-shield production-ready?
- It can be used in production if you pin a maintained release, review the README, and test permissions thoroughly in your application. Treat authorization as security-critical by verifying policies, route protection, and default deny behavior. Check the repository's issue tracker and release history before relying on it in a critical admin panel.
- How does it compare to Spatie Laravel Permission or other Filament permission packages?
- It focuses on Filament admin panel role and permission management and can work alongside a Laravel permission backend such as Spatie's package. Compared with other Filament shield packages, the differences are usually Filament version support, UI features, and maintenance activity. Evaluate the repository's recent commits, issues, and compatibility with your Filament version before choosing.