- How do I install Laravel Permission Editor alongside Spatie Laravel Permission?
- First install Spatie’s package with `composer require spatie/laravel-permission`, configure it, and run migrations. Then add this editor via `composer require ihtisham467/laravel-permission-editor`, publish assets/config with `php artisan vendor:publish`, and secure routes in `config/permission-editor.php`.
- Which Laravel versions does this package support?
- The package is optimized for Laravel 8, 9, and 10. Ensure your project uses PHP 8.0+ and Spatie Laravel Permission v3.x. Check the package’s `composer.json` for exact version constraints before installing.
- Can I customize the UI or extend the permission editor?
- The package provides Blade templates and Laravel Mix assets, but lacks official hooks for deep customization. Override views in `resources/views/vendor/permission-editor` or extend via JavaScript if needed. Forking may be required for major changes.
- How do I secure the `/permission-editor/roles` route?
- Edit `config/permission-editor.php` to add middleware like `auth` or `can:manage-permissions`. Example: `'middleware' => ['auth', 'can:manage-permissions']`. Register the route in `routes/web.php` with the same middleware for consistency.
- What happens if Spatie Laravel Permission updates and breaks compatibility?
- Monitor the package’s changelog for Spatie version locks. If compatibility breaks, check for updates or manually patch the editor. Consider forking or switching to alternatives like Orchid Platform’s permission manager if issues persist.
- Does this package work with Laravel Sanctum or Passport for API guards?
- Yes, if Spatie Laravel Permission supports your guard (e.g., Sanctum/Passport), this editor will work. Ensure Spatie’s `config/permission.php` is configured for your guard before using the editor.
- How do I migrate existing roles/permissions into the editor?
- Run Spatie’s migrations (`php artisan migrate`) to ensure tables exist. Use Spatie’s `Role::create()` or `Permission::create()` methods to seed data, then access the editor at `/permission-editor/roles`. No additional migration steps are required for the editor itself.
- Is there a fallback if this package stops being maintained?
- Yes, alternatives include Orchid Platform’s permission manager or building a custom UI using Spatie’s Eloquent models directly. The editor is a thin layer over Spatie, so core functionality remains accessible.
- Can I use this package in a multi-tenant Laravel app?
- Yes, the editor works with multi-tenant setups as long as Spatie Laravel Permission is configured per tenant. Secure routes with tenant-aware middleware (e.g., `tenant:admin`) in `config/permission-editor.php`.
- Are there any known issues with bulk actions or nested permissions?
- Test bulk actions and nested permissions manually after installation. The package lacks a visible test suite, so verify edge cases like concurrent updates or complex permission hierarchies in your staging environment.