I have a chat app which utilizes Laravel Echo with Pusher (which is similar to Socket.io).
And the issue I'm getting here is I can't update a user online status in database if there's no single user is online on the other side
Been searching on internet and found out about unload event in Javascript, but they told that it's not reliable to handle this problem.
I also have yet to find an event on the Laravel Echo to trigger it even though Pusher records it with "Disconnection" event every time a user load the page or browser is closed
What is the most effective way to handle this?