E
E
Emil Rakhmatullin2019-08-30 15:53:09
Laravel
Emil Rakhmatullin, 2019-08-30 15:53:09

How do you make Real-Time applications with Laravel?

I specifically need to make sure that records from the database are published in the news feed in real time without refreshing the page.
This is necessary because this feed will be displayed on a large screen, and no one will update it, as it were (also on phones and PCs).
I will now follow this path:
1) Events
2) Event broadcasting
3) Learning and using Pusher
Is this correct? Maybe there is an easier way for this purpose?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
J
JhaoDa, 2019-08-30
@JhaoDa

Is it correct?
Yes.
Maybe there is an easier way for this purpose?
Someone and ajax - real-time. If you are one of these "someone", then yes, there is.

R
ReDev1L, 2019-08-31
@ReDev1L

Google Server Side events(SSE).
They are lighter than websockets and made for just that. (websockets are two-way channel, SSE is one-way.)

A
Alex Wells, 2019-08-30
@Alex_Wells

Depends on what kind of data and how much real-time in the project. If everything in the project is real-time, then I would advise you to look at firebase or self-hosted analogues (if you find it) - it will be easier.
If something is simpler, then yes, in this case sockets.
But there is also long-polling.

L
lukoie, 2019-08-31
@lukoie

It's impossible. Do you understand what realtime is? Even if your OS is not realtime, how do you imagine a webserver with realtime?
If you just want to display some information that is recorded in the database, then you need to indicate how critical time is here. That is, "realtime" for you is immediately - within ~ 1-5 seconds or within a minute.
Then it will be possible to know whether something else is suitable to simplify the task, or just push notifications and web sockets.

X
xmoonlight, 2019-08-30
@xmoonlight

Easier - nowhere:
1. IFRAME + META REFRESH
2. setInterval/setTimeout + fetch

V
Victor, 2019-09-01
@Levhav

There is also a comet-server.com service as an analogue of a pusher, only open source

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question