Save form from a header action
Is it possible to save a form from a header action (or before a header action?
Let's say I have the following header actions in an edit form
Is there a way to submit the form before any of those actions is executed? Or somehow submit it inside the button action itself?
I tried this but it doesn't work
Or if there's a way to detect if a form has been changed and then ask for a confirmation to save before proceeding? Any ideas are welcome.
Solution:Jump to solution
Oh okay, you can do something like this:
```php
Action::make('doSomething')
->action(function($record, $data) {...
8 Replies
Hi !
You can try this:
Hey sorry I wasn't clear in my original question. I want to save the form and do something else in the action.
An example would be something like
Thanks for you suggestion though - I think I might actually need it soon!
Solution
Oh okay, you can do something like this:
(not tested)
Oh shit, this actually works haha
😄
TY ❤️
De nada !