- How do I install Filament Workspace Tabs in a Laravel project?
- Run `composer require wezlo/filament-workspace-tabs`, then register the plugin in your Filament panel provider using `WorkspaceTabsPlugin::make()`. Finally, add the Tailwind source directive to your theme CSS and rebuild assets with `npm run build`.
- Does this package work with Filament v4 and v5?
- Yes, the package explicitly supports both Filament v4 and v5. It leverages Filament’s `TOPBAR_AFTER` hook, which remains stable across both versions. Always check the package’s release notes for version-specific updates.
- Will tabs persist after a page refresh or browser restart?
- Yes, tabs are automatically persisted using localStorage. Each Filament panel stores tabs under a unique key (e.g., `filament_workspace_tabs:{panel_id}`), so they survive page reloads and browser restarts unless cleared manually.
- Can I disable drag-and-drop reordering or the context menu?
- Absolutely. Use fluent methods like `->dragReorder(false)` or `->contextMenu(false)` when registering the plugin in your panel provider. This allows you to customize the UX to fit your workflow.
- How do I exclude certain URLs from being opened in tabs?
- Pass an array of URL prefixes to the `excludeUrls()` method, like `->excludeUrls(['/admin/login', '/admin/settings'])`. This prevents those routes from appearing as tabs while keeping others functional.
- Does this package work with Filament’s SPA mode?
- Yes, it fully supports Filament’s SPA mode (enabled via `->spa()`). It integrates with Livewire’s `wire:navigate` for seamless transitions, ensuring tabs behave like a modern browser even in single-page applications.
- Are there any keyboard shortcuts for managing tabs?
- Yes, the package includes native browser-like shortcuts. For example, `Ctrl+W` (or `Cmd+W` on macOS) closes the active tab, and middle-clicking sidebar links opens them in a new tab without affecting the current one.
- Can I customize the localStorage key for tab persistence?
- Yes, use the `persistKey()` method to override the default key. For example, `->persistKey('custom_tabs')` will store tabs under `custom_tabs:{panel_id}`. This is useful for multi-panel apps or GDPR compliance.
- What happens if a user opens more tabs than the default limit?
- By default, the package limits tabs to 20, but you can adjust this with `->maxTabs(25)`. If exceeded, new tabs will open but older ones may be closed automatically to enforce the limit.
- Are there any known conflicts with other Filament plugins?
- Potential conflicts may arise if other plugins use Alpine.js or SortableJS, as this package relies on both. Test thoroughly with plugins like `filament-spa` or drag-and-drop components. Audit your existing JS/CSS for clashes before installation.