Open Confirmation Modal before allowing user to Create a new record

Hi all it seems the CreateAction doesnt allow a confirmation modal before showing the user the create form, does anyone know how i could do this? Thanks in advance
Solution:
Got it ```Action::make('create') ->action(function ($record){...
Jump to solution
1 Reply
Solution
nostrodamned
nostrodamned6mo ago
Got it
Action::make('create')


->action(function ($record){
return redirect(SiteResource::getURL('create',['tenant'=>Filament::getTenant()]));
})
->requiresConfirmation()
->modalDescription('Before creating a site, please ensure it doesnt already exist in our system by searching for it first under the All Sites Tab.')
->modalHeading('Create a new Site')
->modalSubmitActionLabel('I checked! Create new Site')
];
}
Action::make('create')


->action(function ($record){
return redirect(SiteResource::getURL('create',['tenant'=>Filament::getTenant()]));
})
->requiresConfirmation()
->modalDescription('Before creating a site, please ensure it doesnt already exist in our system by searching for it first under the All Sites Tab.')
->modalHeading('Create a new Site')
->modalSubmitActionLabel('I checked! Create new Site')
];
}