Category: Laravel

For a project that I am currently working on, I am creating a chat application within a single page Vue application with a Laravel backend, and then I ran into this problem. I ran into an issue where as I would have users disconnect and reconnect to the chat instance (aka the Echo listeners), they would hear the same event multiple times.

Simply disconnect() and then re-instantiate the Echo object.

Then simply re-attach your listeners and you are good. In my case, I simply created a new Echo instance that I could destroy and re-create as needed for my chat application.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners