Polling
<div wire:poll>
Current time: #now()#
</div><div wire:poll.5000ms>
Current time: #now()#
</div>Invoking Method
<div wire:poll="checkIfCoffeeIsReady">
Current time: #now()#
</div>Last updated
Was this helpful?
You can add a wire:poll annotation to your elements to poll for changes for a set interval. By default, this interval is set to every 2 seconds.
<div wire:poll>
Current time: #now()#
</div>You can append a different interval time to your annotation as well.
<div wire:poll.5000ms>
Current time: #now()#
</div>Polling for changes over AJAX is lightweight and is often a good alternative to strategies such as Pusher or WebSockets.
If you would like to invoke a method during each poll interval, you can do so by specifying a method name.
<div wire:poll="checkIfCoffeeIsReady">
Current time: #now()#
</div>Last updated
Was this helpful?
Was this helpful?