Skip to content

Add a connection status hook (discussion required)#469

Merged
joetannenbaum merged 12 commits intolaravel:2.xfrom
nexxai:2.x
Jan 12, 2026
Merged

Add a connection status hook (discussion required)#469
joetannenbaum merged 12 commits intolaravel:2.xfrom
nexxai:2.x

Conversation

@nexxai
Copy link
Contributor

@nexxai nexxai commented Dec 22, 2025

Problem

I want to be able to determine the current status of my connection to Reverb. As it stands there isn't currently a way to reliably retrieve this status.

Proposed Solution

I have added a useConnectionStatus hook that returns the current status, fetching it from the existing Pusher and Socket.IO libraries behind the scenes.

Notes

I am not currently sold on the return values as strings, but I couldn't come up with anything better that clearly represented the various states. I am very open to alternative suggestions; I just wanted to get something out there so that we could start the discussion.

@joetannenbaum
Copy link
Contributor

This looks super useful, thank you! I'll give this a proper review after the new year and let's do it up 👍

@joetannenbaum
Copy link
Contributor

This looks great, thank you! I ended up removing getConnectionStatus, users can just use echo().connectionStatus(). I also updated the useConnectionStatus hook to subscribe to status changes so that the hook reports changes in real time.

@joetannenbaum joetannenbaum merged commit 375e348 into laravel:2.x Jan 12, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants