Unable to use before() & after() in Wizard form by using submitAction()

public function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('organization')
->schema([
// related form ...
])
])->submitAction(
Action::make('save')
->label(__('Save Changes'))
->submit('save')
->before(function ($action) {
$data = $this->form->getState();
dd('before');
})
->after(function () {
dd('after');
// fireTranslation($this->organization);
})
),
])
public function form(Form $form): Form
{
return $form
->schema([
Wizard::make([
Wizard\Step::make('organization')
->schema([
// related form ...
])
])->submitAction(
Action::make('save')
->label(__('Save Changes'))
->submit('save')
->before(function ($action) {
$data = $this->form->getState();
dd('before');
})
->after(function () {
dd('after');
// fireTranslation($this->organization);
})
),
])
2 Replies
LeandroFerreira
LeandroFerreira2mo ago
Not sure if you can use these methods in that action, but you could try to use lifecycle hooks instead of this
SkyEagles
SkyEaglesOP2mo ago
Thank you for your reply. What I want to achieve is to check after user fill the wizard form.

Did you find this page helpful?