- How do I install Filament Browser Notifications without breaking my existing Filament setup?
- Run `composer require emuniq/filament-browser-notifications` followed by `php artisan browser-notifications:install`. The package auto-registers on all Filament panels, requires no manual plugin setup, and handles migrations, VAPID keys, and trait injection automatically. If your User model is read-only, it skips the trait step and provides manual instructions.
- Will this work with Laravel 9.5+ and Filament v3.x?
- Yes, the package explicitly supports Laravel 9+ and Filament v3+. It leverages Filament’s event-driven architecture and Notification system, ensuring compatibility with the latest versions. Always check the package’s changelog for minor version updates, as Filament’s API may evolve.
- Can I customize the browser notification appearance (e.g., icons, colors, or Blade templates)?
- Absolutely. The package supports Blade templating for notifications, allowing you to align them with your Filament admin’s design system. You can override default views or use CSS variables to match themes like dark mode. Documentation for customization is provided in the README.
- How does this handle browser permission prompts for notifications?
- The package includes a configurable subscription prompt that appears after a delay, asking users to enable push notifications. It gracefully handles permission denials and provides a profile section to manage subscriptions. You can adjust the timing or behavior via configuration.
- Will this conflict with existing Laravel notifications (e.g., Mail, Slack, or database notifications)?
- No, it integrates with Laravel’s built-in `sendToDatabase()` method and hooks into Filament’s Notification system. It won’t interfere with other channels like Mail or Slack. However, ensure your notifications are explicitly sent to the `database` channel if you want browser notifications triggered.
- What happens if a user blocks notifications in their browser?
- If a user denies permission, the package respects their choice and won’t re-prompt. You can still send silent database notifications, but browser alerts won’t appear. The profile section clearly shows their subscription status, allowing them to re-enable notifications manually.
- Can I use this for high-frequency alerts (e.g., live updates or stock tickers)?
- While possible, browser notifications are best suited for critical or infrequent alerts to avoid permission fatigue. For high-frequency updates, consider rate-limiting or using in-app Filament notifications instead. The package doesn’t enforce limits, but overuse may degrade user experience.
- Do I need to write a service worker or handle Web Push manually?
- No, the package handles everything automatically. It serves the service worker via a dedicated route and manages VAPID keys, subscriptions, and push events under the hood. You only need to ensure your Filament admin is served over HTTPS for push notifications to work.
- How do I test browser notifications in development?
- Use tools like Chrome’s Application tab to simulate push events or manually trigger notifications via `php artisan tinker`. For cross-browser testing, consider BrowserStack or LambdaTest. The package doesn’t require additional setup—just ensure your local environment supports HTTPS (e.g., via Laravel Valet or `trust` proxy).
- Are there alternatives to this package for Filament browser notifications?
- If you’re looking for alternatives, consider `spatie/laravel-webpush` for standalone Laravel projects or `filament/filament-notifications` for in-app alerts. However, this package is specifically optimized for Filament v3+, offering seamless integration with zero manual configuration. It’s the most developer-friendly option for Filament users.