SaveFormAction : requiresConfirmation()

What I am trying to do : I just want to add a confirmation modal when the "save changes" button is clicked for My Edit{Resource}. To do that, I overrided the getSaveFormAction method (see code below)

What I did : nothing and no errors in console or in the page

Code :

php 
<?php

namespace App\Filament\Resources\AdGroupResource\Pages;

use App\Filament\Resources\AdGroupResource;
use Filament\Actions\Action;
use Filament\Resources\Pages\EditRecord;

class EditAdGroup extends EditRecord
{
    protected static string $resource = AdGroupResource::class;

    protected function getHeaderActions(): array
    {
        return [];
    }

    protected function afterSave(): void
    {
        $this->dispatch('landing-page-saved');
    }

    protected function getSaveFormAction(): Action
    {
        return Action::make('save')
            ->label(__('filament-panels::resources/pages/edit-record.form.actions.save.label'))
            ->requiresConfirmation()
            ->submit('save')
            ->keyBindings(['mod+s']);
    }
}


Is there another way to accomplish that ?
Was this page helpful?