Introduction
By default, Filament will send flash notifications via the Laravel session. However, you may wish that your notifications are ābroadcastā to a user in real-time, instead. This could be used to send a temporary success notification from a queued job after it has finished processing. We have a native integration with Laravel Echo. Make sure Echo is installed, as well as a server-side websockets integration like Pusher.Sending broadcast notifications
There are several ways to send broadcast notifications, depending on which one suits you best. You may use our fluent API:notify() method:
toBroadcast() method:
Setting up websockets in a panel
The Panel Builder comes with a level of inbuilt support for real-time broadcast and database notifications. However there are a number of areas you will need to install and configure to wire everything up and get it working.- If you havenāt already, read up on broadcasting in the Laravel documentation.
- Install and configure broadcasting to use a server-side websockets integration like Pusher.
- If you havenāt already, you will need to publish the Filament package configuration:
- Edit the configuration at
config/filament.phpand uncomment thebroadcasting.echosection - ensuring the settings are correctly configured according to your broadcasting installation. - Ensure the relevant
VITE_*entries exist in your.envfile. - Clear relevant caches with
php artisan route:clearandphp artisan config:clearto ensure your new configuration takes effect.