I
I
Ivan Zhuk2020-11-20 17:42:59
Laravel
Ivan Zhuk, 2020-11-20 17:42:59

I want to write a chat using laravel-echo-server?

I want to write a chat, I use laravel-echo-server

In vue via axios, I send a message
to the controller in the controller, I call ChatEvent::dispatch( $request->input('message') )
in the event I write it to a variable and call Chanel('chat' )
in vue I listen to port 6001 and when the event fires, the code inside should work, but it does not work
5fb7d5a699348724900048.png
5fb7d5c947543616334295.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
pLavrenov, 2020-11-20
@pLavrenov

The answer can be found in the documentation . Ideally, just read the necessary topics in full and you will understand what is there and where to look.
And for debugging, it is better to use the chrome debugger (or what is convenient) Network -> WS, here you need to at least check whether the application is connected. And whether it receives these messages at all.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question