2

I've been fiddling a lot lately with Laravel Echo and Laravel Echo Server, a socket.io server implementation for Laravel Echo.

There's not much on the web, and I'm probably missing some point..

I can see from the cli of laravel-echo-server when a user joins or leaves a channel (presence channel in my case). I have a Laravel Event that performs some DB operations that I want to fire when a user leaves a presence channel. How can I achieve this?

Thanks

Edo San
  • 58
  • 8

1 Answers1

0

Echo.join(`chat.${roomId}`)
    .here((users) => {
        //
    })
    .joining((user) => {
        console.log(user.name);
    })
    .leaving((user) => {
        console.log(user.name);
    });
Gravity Co
  • 28
  • 7