FilamentF
Filament14mo ago
sparmin

How to refresh form data?

I have a Game object which can be controlled via the GamesResource. The first screenshot shows the section with actions and status messages inside the form.
The second screenshot shows part of my Game model.

Currently everything works (nearly) as desired: The status messages show the correct status, the buttons apply the correct changes to the Game object. But clicking a button, for example "Next round", needs me to refresh the page manually in order to see the change of status from "Current round: 1" to "Current round: 2".

How do I achieve an automatic refresh, either of the page, or the section or the whole form?

I stumbled upon EditRecord::refreshFormData() as you can see, but couldn't really make it work properly, because funnily enough, the current solution works for Starting and Finishing the game, but not for Next Round.
image.png
image.png
Was this page helpful?