TjardoOrtan
How can I conditionally show a confirmation modal during a resource edit form save.
That didn't workout for me. i managed to solve it different:
protected function getSaveFormAction(): Action
{
$data = $this->data;
$action = Action::make('save')
->label(('filament-panels::resources/pages/edit-record.form.actions.save.label'))
->action(function () {
$this->save();
});
if ($data['languages_removed']) {
$action->requiresConfirmation()
->modalHeading(('app.messages.user_language_warning_text'))
->modalWidth(MaxWidth::Medium);
}
return $action;
}
5 replies