You can indeed only broadcast from the event itself and not from a listener!
This might help as well, however I'm not sure if that also works for events! https://alanstorm.com/understanding-laravel-sparks-swap/
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Dear all,
I'm currently working on my project based on Spark, and I try to accomplish that whenever the Laravel\App\Events\NotificationCreated event gets fired, my event listener picks up on this and triggers ShouldBroadcast to send a notification to Pusher that a new notification has been created.
The event triggers the listener, so that all goes well, but nothing gets pushed to Pusher. There aren't any errors either, so that's not helpful.
When I implement ShouldBroadcast in the original Spark event, all gets pushed to Pusher as it should, so there are no other infrastructural problems.
Questions from my side:
Thanks for your help! Vincent
Thanks for letting me know, Bobby!
I tried out swapping NotficiationRepository@create with a new method, which refers to my custom event, but swap does not seem to work on the NotificationRepo.
However, I got it to work by firing my new custom event (which broadcasts to Pusher) via the listener, that is listening to the original Spark event. It sounds messy, but hey - it works!
Please or to participate in this conversation.