- How does this package differ from Spatie Laravel Permission alone?
- This package extends Spatie Laravel Permission with a full-featured UI built on Livewire 3 and FluxUI Pro, including category-based organization, color-coded badges, protected roles, and user assignment safeguards. It’s ideal if you need a ready-made admin interface rather than just the backend logic.
- Can I use this package with Laravel 11 or older?
- No, this package requires Laravel 12+ due to its Livewire 3 and PHP 8.2+ dependencies. If you’re on Laravel 11 or older, you’d need to backport dependencies manually, which isn’t officially supported.
- What happens if I don’t use FluxUI Pro? Can I replace it?
- FluxUI Pro is optional for core functionality, but the package relies on its components for the UI. You can fork or replace its components with alternatives like Tailwind UI or custom Blade/Livewire components, though this may require additional development effort.
- Does this package support custom permission models or storage engines?
- No, it tightly couples with Spatie Laravel Permission’s default storage (database tables). If you need custom storage (e.g., Redis, a custom ACL), you’d need to modify the package or use Spatie’s core package directly.
- How do I migrate existing permissions from a custom system to this package?
- You’ll need to manually map your existing permissions/roles to Spatie’s schema (e.g., `permissions` and `roles` tables) before running the package’s migrations. The package doesn’t include migration tools for third-party systems, so test thoroughly to avoid data loss.
- Is Livewire 3 a hard requirement? Can I use Inertia.js or Alpine.js instead?
- Livewire 3 is required for the UI components. If you’re using Inertia.js or Alpine.js, you’d need to rebuild the frontend or extract the backend logic (e.g., permission CRUD) and integrate it with your preferred frontend framework.
- What are the performance implications of using UUIDs for permissions?
- UUIDs add minimal overhead compared to auto-increment IDs, especially with Laravel’s UUID support. However, they may impact indexing and joins in large-scale applications. The package is optimized for typical Laravel projects, but benchmark if you expect millions of permissions.
- How do I customize the permission categories or colors?
- Create a custom enum implementing `HasColor` (as shown in the README) and bind it to the package’s configuration. You can override colors, labels, or even add new categories while maintaining compatibility with the UI.
- Are there any alternatives to this package for Laravel permission UIs?
- Yes, alternatives include **Spatie’s standalone UI** (basic Blade views), **Laravel Nova’s built-in permissions**, or **custom Livewire/Inertia solutions**. This package stands out for its FluxUI Pro integration, category system, and protected roles, but choose based on your UI stack and licensing needs.
- How do I handle protected roles (e.g., preventing admin deletion)?
- The package automatically enforces protected roles via the `is_protected` flag in the `roles` table. You can extend this logic by overriding the `canDeleteRole` method in your service provider or adding custom validation before deletion.