A
A
Andrey Suha2019-08-15 09:03:13
Laravel
Andrey Suha, 2019-08-15 09:03:13

How to send a message through a socket?

I want to use this thing on a project . I use radish, laravel-echo-server and socket.io for this. How to listen to messages is clear, it is not clear how to send a message to the channel so that it can be processed on the side of Lara. Really the only option is to listen to the channel to get the message, and send via ajax?
Ps do not judge strictly the first experience with sockets))
Pss Lara 5.8 is just not very friendly with English

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Malyarov, 2019-08-15
@Konstantin18ko


Other Only
When creating an application that uses event broadcasting, you can replace the event function with a broadcast function. Like the event function, the broadcast function sends an event to your server listeners:
broadcast(new ShippingStatusUpdated($update));
Quoted from this handbook.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question