0

I have a project for food ordering and deliverying. Basically this is a concept of project:

  • User order a food in some restaurant
  • That order of that restaurant is showing specifically to the manager of that restaurant
  • Manager is getting SMS notification about new order
  • He needs to refresh his dashboard to see new order

The point is in the last step Manager needs to refresh his dashboard to see new order. I'm using livewire and Laravel 7 framework, is there any way for the manager to get new orders in realtime?

I know for livewire polling but I don't want to use that because it can cause server problems in large quantities of using it. Is there any other way? Something like mount() function or emit ?

Milos
  • 552
  • 2
  • 7
  • 32

1 Answers1

2

I've never used this feature but it seems you need broadcasting

In many modern web applications, WebSockets are used to implement realtime, live-updating user interfaces. When some data is updated on the server, a message is typically sent over a WebSocket connection to be handled by the client. WebSockets provide a more efficient alternative to continually polling your application's server for data changes that should be reflected in your UI.