Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

petervandijck's avatar

A good approach to Livewire and having "doing..." / "done" states?

Hi, what would be a good, standard and simple approach to do the following with Livewire and Laravel.

  • I have a model with, say, Items. They have a status field.
  • I am listing 20 items on a web page, with status "updating...".
  • In the background, I have queue Workers updating the model.
  • Once the db field "status" is switched by a Worker from 0 to 1, I would like on the web page to change from "updating" to "done" for that particular item.

I suspect this is easy/standard (?) but I'm a Livewire newbie :) What's the general approach to take here? Thank you for any input!

0 likes
6 replies
petervandijck's avatar

@martinbean Thank you! I will check that out, but I would rather sync it with a database value, as in, if the field "status" turns from 0 to 1, we update the frontend. What would be the approach for that? I don't really want to use Events and am trying to keep the architecture as simple as possible.

martinbean's avatar

I would rather sync it with a database value, as in, if the field "status" turns from 0 to 1, we update the frontend. What would be the approach for that?

@petervandijck You can’t “sync” to data in a database. This is why you dispatch/broadcast events when data changes that you’re interested in. Broadcasting is the “approach for that”.

I don't really want to use Events and am trying to keep the architecture as simple as possible.

Then I’m afraid you’re not going to be able to respond to anything changing without reloading pages, if you don’t use events. Also introducing Livewire to your stack is not with keeping architecture as simple as possible.

MohamedTammam's avatar

If you don't want to use events, there's an option to use poll if you the updates happens quickly.

Please or to participate in this conversation.