S
S
semki0962020-01-29 03:13:31
Socket.io
semki096, 2020-01-29 03:13:31

Why is Broadcasting needed in Laravel?

I can't understand why Broadcasting is needed in Laravel? For example, a chat - after all, I can send all messages to connected clients using js (node.js + socket.io). Why include php and laravel in this process. I must have missed something, I would be grateful for clarification.

For example, I have the task of plotting a graph. How I imagine it. I need to make a request to a third-party api every second and find out the price of a dollar (on js apparently). Having received this data, I write it to the database and simultaneously send it to connected clients via sockets. Here in my logic I use only js.

Question - do I need to look towards Broadcasting in my task, if so, why, am I missing something?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Suha, 2020-01-29
@andreysuha

If you use laravel echo server, then node.js is still used under the hood. at the expense of Broadcasting, you can use node, which is good, but if you need to transfer a message from the laravel application to the client, what will you do? This is where broadcasting is needed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question