© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
1 reply
૨σɳ

Custom confirmation modal

Hello Community !

Could anyone advise me the best ‘filament way’ to have a custom confirmation in my case ?

I have a calendar showing events which are linked to resources, like “teacher” or “classroom”.

There are different ways to create or modify the events :
1. A classic form with a save action
2. The same form, but the user can click in the calendar to create the event on that day (not actual code for clarity)
<div x-on:click="$wire.onDayClick( {{$timestamp}} )" ... />
<div x-on:click="$wire.onDayClick( {{$timestamp}} )" ... />

#[On('onDayClick')]
public function onDayClick($day)
{
    $this->validate();

    $f=$this->getFormValuesAsArray();
    $f['date'] = Carbon::createFromTimestamp($day)->toDateString();

    // Ask confirmation if needed

    $event = Event::create($f);
    …
}
#[On('onDayClick')]
public function onDayClick($day)
{
    $this->validate();

    $f=$this->getFormValuesAsArray();
    $f['date'] = Carbon::createFromTimestamp($day)->toDateString();

    // Ask confirmation if needed

    $event = Event::create($f);
    …
}

3. Moving an event (drag & drop) between days
onEnd: function(evt) {
        const eventId = evt.item.id;
        const toDate = evt.to.dataset.statusId;
        @this.dispatch('onEventDropped', {
            eventId: eventId,
            toDate: toDate
        });
}
onEnd: function(evt) {
        const eventId = evt.item.id;
        const toDate = evt.to.dataset.statusId;
        @this.dispatch('onEventDropped', {
            eventId: eventId,
            toDate: toDate
        });
}

#[On(' onEventDropped ')]
    public function onEventDropped($eventId, $toDate)
    {
        $day=Carbon::createFromTimestamp($toDate);
        $event=Event::find($eventId);
        
        // Ask confirmation if needed

        $event->update(['date' => $day]);
    }
#[On(' onEventDropped ')]
    public function onEventDropped($eventId, $toDate)
    {
        $day=Carbon::createFromTimestamp($toDate);
        $event=Event::find($eventId);
        
        // Ask confirmation if needed

        $event->update(['date' => $day]);
    }


If one or more of the resources linked to the event is already occupied in another event, I’d like to ask confirmation to the user, and then proceed with the modification or cancel it.

Case #1 can use requiresConfirmation() logic, this one is obvious.

But for #2 and #3, I don’t see the ‘right’ way to do it…

And of course, I’d like to have something that can be used in all the cases.

Any ideas ?

Thanks for your time
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources
Was this page helpful?

Similar Threads

Recent Announcements

Similar Threads

Confirmation message on custom action modal
FilamentFFilament / ❓┊help
3y ago
Checkbox Confirmation Modal
FilamentFFilament / ❓┊help
13mo ago
How to add custom confirmation modal with repeater?
FilamentFFilament / ❓┊help
2y ago
toggleColumn with confirmation modal
FilamentFFilament / ❓┊help
2y ago