From 5557bf31aac60bf883d73aea37037e4f954b3791 Mon Sep 17 00:00:00 2001 From: Brent Kelly Date: Thu, 20 Jun 2024 10:44:20 +1200 Subject: [PATCH] added documentation for broadcast notifications using the panel builder --- packages/panels/docs/07-notifications.md | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/panels/docs/07-notifications.md b/packages/panels/docs/07-notifications.md index 8b3279414c..45031569c6 100644 --- a/packages/panels/docs/07-notifications.md +++ b/packages/panels/docs/07-notifications.md @@ -32,3 +32,29 @@ public function panel(Panel $panel): Panel ->databaseNotificationsPolling('30s'); } ``` + +## Broadcast notifications + +The Panel Builder comes with a level of inbuilt support for real-time broadcast notifications. However there are a number of areas you will need to install and configure to wire everything up and get it working. + +1. If you haven't already, read up on [broadcasting](https://laravel.com/docs/broadcasting) in the Laravel documentation. +2. Install and configure broadcasting to use a [server-side websockets integration](https://laravel.com/docs/broadcasting#server-side-installation) like Pusher. +3. If you haven't already, you will need to publish the Filament package configuration: + +```bash +php artisan vendor:publish --tag=filament-config +``` + +4. Edit the configuration at `config/filament.php` and uncomment the `broadcasting` section - ensuring the settings are correctly configured according to your broadcasting installation. +5. Ensure the [relevant `VITE_*` entries](https://laravel.com/docs/11.x/broadcasting#client-pusher-channels) exist in your `.env` file. +6. Clear relevant caches with `php artisan route:clear` and `php artisan config:clear` to ensure your new configuration takes effect. +7. Rebuild your javascript and publish assets: + +```bash +npm run build +php artisan filament:assets +``` + +Your panel should now be connecting to your communications service. For example if you log into the Pusher debug console you should see an incoming connection each time you load a page. + +To send a real-time notification, see the [broadcast notifications documentation](/docs/notifications/broadcast-notifications).