How to Reload Dashboard Widget from Other Widget after Modal Action?

I have 2 admin widget: borrowed list widget and returned lists widget. on borrowed lists widget i have a modal action that mark as return and it will move the record to returned widget. from this widget, how can I reload the returned widget to instantly reflect the changes?
No description
6 Replies
krekas
krekas15mo ago
Fire event on one widget ant listen in other. Then refresh
WillThatch
WillThatchOP15mo ago
I just added this to ReturnedItems Widget protected $listeners = ['updateLatestReturnedItems' => '$refresh']; and fire emit from BorrowedItems Widget inside modal action $this->emit('updateLatestReturnedItems'); Found the solution here: https://filamentphp.com/community/how-to-refresh-widgets-when-table-actions-are-fired
Filament
How to Refresh Widgets When Table Actions Are Fired by Leandro Ferr...
A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
krekas
krekas15mo ago
Same thing as written there
WillThatch
WillThatchOP15mo ago
yes this is another way. thanks for sharing this. It is a big help to understand the flow.
Jota Ele
Jota Ele14mo ago
filter
Want results from more Discord servers?
Add your server