- How do I convert a standard Filament notification to a modal without breaking existing code?
- Simply chain `->asModal()` to your `Notification::make()` call. For example, `Notification::make()->title('Success')->asModal()->send()`. All existing methods like `->danger()`, `->actions()`, or `->success()` remain unchanged and work seamlessly with the modal.
- Will modals stack if multiple notifications fire in one request?
- No, modals are queued automatically. Users dismiss one modal at a time, and the next in the queue appears immediately. This prevents overwhelming users with overlapping modals.
- Does this package work with Filament 4 and 5?
- Yes, the package supports both Filament 4 and 5. It’s designed to integrate cleanly with Filament’s notification system, regardless of the version, as long as you’re using Laravel 11 or 13.
- How do I customize the modal’s appearance (e.g., width, close button label) per panel?
- Publish the config with `php artisan vendor:publish --tag=filament-modal-notifications-config` and adjust settings like `modal_notifications.width` or `modal_notifications.close_button_label` in your `filament.php` file. These defaults apply panel-wide.
- Can I conditionally show a modal or fall back to a toast?
- Yes, use `->asModal($condition)`. If `$condition` is false, the notification renders as a standard toast. This is useful for non-critical alerts where a modal isn’t necessary.
- Will this package interfere with other Livewire components or custom events?
- No, the package uses Filament’s internal Livewire event system and isolates its session keys. As long as you register the plugin in your `PanelProvider` before other notification logic, there’s no risk of conflicts.
- How do I handle rapid successive notifications that could overwhelm the queue?
- The package includes built-in queuing logic to prevent starvation. Modals are processed sequentially, and the system handles dismissal events gracefully. For extreme cases, consider throttling notifications at the application level.
- Does this work with Laravel’s testing tools (e.g., Pest or PHPUnit)?
- Yes, the package is designed for testability. You can trigger modals in tests by dispatching Livewire events or simulating user interactions. The README includes examples for testing modal rendering and dismissal.
- What happens if Filament updates and breaks the notification API?
- The package is built to be backward-compatible. If Filament introduces breaking changes, the author will release updates with deprecation warnings and migration paths. Always check the changelog for Filament 6+ compatibility notes.
- Are there alternatives to this package for modal notifications in Filament?
- While there aren’t direct alternatives, you could manually create modals using Filament’s `Modal` component or third-party packages like Livewire Modals. However, this package offers a seamless, one-line integration that preserves all existing notification features without extra boilerplate.