Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

shaiful's avatar

Not sure what feature to use to broadcast events from API to clients

Hi there,

I have a high level API implementation question.

Say I have built an API using Laravel and then on the client side I have apps on several different platforms consuming the API. One app may be built using Laravel (in a separate installation than the API), another is a native Android app and another is a native iOS app.

I need a way for the API to notify all of its clients when some actions has happened so that the apps can be synced. Imagine if I am building something like Trello. When a card is added using the Trello web app, we can see it reflected on the Trello mobile app almost immediately.

My questions is, what should I use to enable a functionality like this, both on the API side (as the event broadcaster) and the client side (as the event listener)? To keep things simple, assuming the client app is also built on Laravel.

I have read the Laravel docs/tutorials about Events, Broadcasting, Notifications and Webhooks but I couldn't get a definite answer. Broadcasting looks promising but I think it is meant only for apps within the same Laravel installation.

Thank you.

0 likes
1 reply
D9705996's avatar

I would fire an event for CardAdded and broadcast your event following the documentation

https://laravel.com/docs/5.7/broadcasting

This uses websockets so you can find websockets libraries for iOS and Android and they will also receive the events.

https://github.com/MrBin99/LaravelEchoAndroid https://github.com/val-bubbleflat/laravel-echo-ios

The above uses laravel echo that makes the client side a bit easier.

It won't be easy but is doable and the correct feature from laravel to implement realtime

Please or to participate in this conversation.