Broadcasting after export completed
Is there a way to broadcast the notification to the user when export is done?
Broadcasting is running already and want to have this in addition to the database notification but don't know where to implement it.
8 Replies
You can probably broadcast using render hooks (https://filamentphp.com/docs/3.x/support/render-hooks) to inject the proper frontside JS
broadcasting is already working
Can I ask why you want database notifications and broadcasting? It feels like a lot of extra work for the same result
filaments new built-in export is sending databsse notifications after export has been completed
but i also want a broadcast message as some users might not notice the small notification (bell) in header
after their export is ready to download
got it
So you mean the page is properly receiving the broadcast, and now you want to display the notification?
no, i mean that filament already supports broadcasting (i've tested it with tinker)
but i don't know how i can get the built-in export action sending a broadcast notification (in addition to the database notification)
something like this (from my tinker test):
Oh I get it now
Yeah it doesn't look like there's a direct option to customize that
I think the only option would be to follow the steps on customizing the job (https://filamentphp.com/docs/3.x/actions/prebuilt-actions/export#customizing-the-export-job) and adding something to this file (https://github.com/filamentphp/filament/blob/3.x/packages/actions/src/Exports/Jobs/PrepareCsvExport.php)
GitHub
filament/packages/actions/src/Exports/Jobs/PrepareCsvExport.php at ...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS. - filamentphp/filament