Socket.io post for Laravel

I am creating an application that should send messages to the server. I use Laravelwith predisserver side event processing.

Is it possible that socket.ioemits events that I can listen with predis?

Something like this on the client side:

io.emit('testChannel:someEvent', { dataOne: 'data', dataTwo: 'data' });

Then backstage Laravel:

public function listen()
{
    Redis::subscribe(['testChannel'], function($message) {
        dd($message);
    });
}

I would like to provide more information, but I can confuse the whole process.

Thanks in advance.

+4
source share

Source: https://habr.com/ru/post/1618728/


All Articles