Display confirmation modal after state updated

Hey everyone, I'm trying to implement confirmation modal functionality when form input state changes like:
Flatpickr::make('time')
->animate()
->time()
->live()
->required()
->visible(fn (Get $get) => $get('date') !== null)
->afterStateUpdated(function (Get $get, Set $set, ?string $old, ?string $state) {
if (Artist::find($get('../../artist_id'))->isSlotReserved($get('date'), $state)) {
Notification::make()
->title('This slot is not available!')
->danger()
->seconds(5)
->send();
}
})
Flatpickr::make('time')
->animate()
->time()
->live()
->required()
->visible(fn (Get $get) => $get('date') !== null)
->afterStateUpdated(function (Get $get, Set $set, ?string $old, ?string $state) {
if (Artist::find($get('../../artist_id'))->isSlotReserved($get('date'), $state)) {
Notification::make()
->title('This slot is not available!')
->danger()
->seconds(5)
->send();
}
})
Instead of a simple notification I want to show the confirmation modal to user to verify if he wants to continue with duplicate entry. Is it possible? Thank you for your help!
0 Replies
No replies yetBe the first to reply to this messageJoin