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

Modi.Bade's avatar

Leave Laravel-Echo Private Channels

hi guyz,

im using laravel-echo in my reactJs app for websocket connections

how can i disconnect or close websocket connection manualy in componentWillUnmount ?

0 likes
6 replies
Modi.Bade's avatar

@Snapey tahnk exactly i even use leaveChannel method or leave method ( described at laravel document ) but nothing happend

Modi.Bade's avatar

@Sinnbeck i checked Echo object prototypes and there was a function named disconnect

we can use like this :

this.Echo.disconnect();

thank you for your answer

Please or to participate in this conversation.