How to hard page reload after Update button's action is done?
The current state of the Update button on the edit page is that it doesn't hard reload the page.
But I need that somehow.
How to do that? Basically I want that after the update the whole page is hard reloaded - like when you presse cmd + R or ctrl + R in browser.
8 Replies
Currenty it just shows the toast and nothing reloads.
Also, I have a custom button on the Edit page:
and it is behaving the same, I need to manually reload the Edit page to see the changes. Pressing the button just save the change in the DB but doesn't reload the page itself.
Can I add something to this Action::make code to make it reload the page after $this->save() is finished?
It could be a hard refresh as I said. But if it's possible with livewire navigate type of refresh that's great.
Thank you in advance for any help.
If I try this:
it seems to refresh the form on save and I see the status changed after the click. But the buttonpanel doesn't reflect the change I setup in the
getFormActions
method on the Edit page where I do an if condition and displaying custom buttons based on the state.
And it seems that this "getFormActions" method is not reloaded on each mouse click on buttons there.
Perhaps I can force it to reload the buttons section (Save, Cancel, ...) on each Edit page?
Or the easiest way would be a hard page reload 😉
Is it some command to stick inside ->action() to do the hard page reload after the saving part is done?Could this issue be related to this: https://stackoverflow.com/questions/77527634/how-on-form-saving-fresh-header-button-hidden-condition
Stack Overflow
How on form saving fresh header button hidden condition?
In laravel 10 / filamentphp 3 app I use status selection input with several options and depending on current status button in
getHeaderActions() I need to show/hide button, which opens modal dialog...
Caching?
send getFormActions
i know how to force a page reload but i bet you dont need it
Solution
Hmm, thanks. Interesting, maybe I don't even need the if condition and it can be all done via
visible()
. We will see. Thanks.
One question though.
Do I need to put return;
at the end of code inside ->action()?
Which one is the correct form? This one:
or this one:
?