Using refreshFormData() in static form methods
Hello everyone,
I am a little confused by the "Refreshing form data" part of the documentation. It states that if "you're using actions on an Edit or View resource page, you can refresh data within the main form" which is exactly what I want.
The example provided is:
The thing is that a resource page's
The obvious error (if someone searches by keyword):
What am I missing here?
I suppose there is a way to inject the property into the function?
I am a little confused by the "Refreshing form data" part of the documentation. It states that if "you're using actions on an Edit or View resource page, you can refresh data within the main form" which is exactly what I want.
The example provided is:
The thing is that a resource page's
form method is static, and therefore it is not possible to call $this->refreshFormData() from within the action method.The obvious error (if someone searches by keyword):
What am I missing here?
I suppose there is a way to inject the property into the function?
Solution
In this context, iirc, you can inject $livewire into the ->action() callback then call it off of the $livewire object.
