Saving Wizard Form Contents at Each Step

I am looking to automatically save the entries in a wizard step each time the next one is called, is there anything special that I need to take into account? Do I need to manually take care of loading the contents from the model to continue later Thank you in advance
5 Replies
petrisorcraciun
petrisorcraciun16mo ago
Step::make('step1')->afterValidation(function() { your_code} ); you have two point which can be used: afterValidated(afterValidation) or beforeValidation is in "Filament\Forms\Components\Wizard\Step"
ssmusoke
ssmusokeOP16mo ago
Thank you let me try this out Interesting question, how do I access the form values and the record in the afterValidation method?
Shipu Ahamed
Shipu Ahamed16mo ago
->afterValidation(function ($state, $livewire, $component) {
// do magical things
})
->afterValidation(function ($state, $livewire, $component) {
// do magical things
})
.najibahmed
.najibahmed15mo ago
how to change the label of next button to 'Save & next'?
Atreides
Atreides4mo ago
use Filament\Forms\Components\Actions\Action; use Filament\Forms\Components\Wizard; Wizard::make([ // ... ]) ->nextAction( fn (Action $action) => $action->label('Save & next'), )
Want results from more Discord servers?
Add your server