Wizard Trigger Next Steps From Notification.

So I checked the data after validation was carried out, and if the data is not similar then I will give the user a warning in the notification like the code below. This notification has actions to cancel and continue, but I'm confused about how to trigger the wizard next step from this notification. Can I get help here?
Wizard\Step::make('grading-insiden')
->label('Grading Insiden')
->afterValidation(function ($state, $set, $get, $livewire) {
if (Str::lower($state['auto_grading_color']) != Str::lower($state['grading_risiko'])) {
\Filament\Notifications\Notification::make()
->warning()
->title('Grading Risiko Tidak Sesuai')
->body('Grading Risiko yang diinput tidak sesuai dengan Grading Risiko yang dihasilkan')
->actions([
\Filament\Notifications\Actions\Action::make('continue')
->label('Lanjutkan')
->button()
->close()
->action(function () use ($livewire) {
// INFO : How to trigger next srteps ?
}),
\Filament\Notifications\Actions\Action::make('cancel')
->label('Batal')
->color('gray')
->close(),
])->persistent()->send();

throw new Halt();
}
})
Wizard\Step::make('grading-insiden')
->label('Grading Insiden')
->afterValidation(function ($state, $set, $get, $livewire) {
if (Str::lower($state['auto_grading_color']) != Str::lower($state['grading_risiko'])) {
\Filament\Notifications\Notification::make()
->warning()
->title('Grading Risiko Tidak Sesuai')
->body('Grading Risiko yang diinput tidak sesuai dengan Grading Risiko yang dihasilkan')
->actions([
\Filament\Notifications\Actions\Action::make('continue')
->label('Lanjutkan')
->button()
->close()
->action(function () use ($livewire) {
// INFO : How to trigger next srteps ?
}),
\Filament\Notifications\Actions\Action::make('cancel')
->label('Batal')
->color('gray')
->close(),
])->persistent()->send();

throw new Halt();
}
})
1 Reply
HALIM
HALIMOP6d ago
I have tried it by making a step like this Wizard\Step::make('detail-insiden') then adding extraAlpineAttributes to wizard
->extraAlpineAttributes([
'step-detail-insiden' => "step='detail-insiden'",
])
->extraAlpineAttributes([
'step-detail-insiden' => "step='detail-insiden'",
])
and use dispatch on notificatoin actions, but noting happen
\Filament\Notifications\Actions\Action::make('continue')
->label('Lanjutkan')
->button()
->dispatch('step-detail-insiden'),
\Filament\Notifications\Actions\Action::make('continue')
->label('Lanjutkan')
->button()
->dispatch('step-detail-insiden'),

Did you find this page helpful?