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

scheMeZa's avatar

Laravel Echo get presence channel's connected users WITHOUT joining channel

Is there a way for me to get a presence channel's connected users without joining the channel?

I have a "global" presence channel instance that runs on every page to see what users are online in realtime. I use this information to filter rows from my database by who's online on the website right now. I use vue to accomplish this.

Another place where this would be helpful is: I have chatrooms and have an index page where I list all chatrooms. I want to show how many users are connected to those chatrooms without joining it.

Thanks for the help; I hope I gave enough context!

0 likes
5 replies
mmanieri's avatar

This would also interests me. Anyone has any idea?

scheMeZa's avatar

@mmanieri I actually think it's a simple question that I asked. When I dealt with it, I forgot something important. I was using redis; it should have all information I wanted to pull in. You should be able to get all the information from redis.

mmanieri's avatar

Sure but to have the data accessible from the client would need a few additional "not very laravelish" steps.

Same for pusher (webhooks)

mmanieri's avatar

Echo server, but the API are for the server, not the clients.

My specific case is: the app is open to operators, customers' and suppliers' users.

While the operators must see anybody on line, customers must only see the operators and that company's users online. Suppliers as well must only see operators and their own colleagues from the same supplier.

Currently I'm just filtering out via JavaScript a single general presence channels, but the browser actually receives all the joins and leave.

I tried to design a multiple presence channels system but since I don't know which companies or suppliers could be on line at a given moment I should have the operators' sessions subscribed to all the (potentially empty) companies' and suppliers' presence channels...

Please or to participate in this conversation.