label(__('filament-support::actions/force-delete.single.label')); $this->modalHeading(fn (): string => __('filament-support::actions/force-delete.single.modal.heading', ['label' => $this->getRecordTitle()])); $this->modalButton(__('filament-support::actions/force-delete.single.modal.actions.delete.label')); $this->successNotificationTitle(__('filament-support::actions/force-delete.single.messages.deleted')); $this->color('danger'); $this->icon('heroicon-s-trash'); $this->requiresConfirmation(); $this->action(function (): void { $result = $this->process(static fn (Model $record) => $record->forceDelete()); if (! $result) { $this->failure(); return; } $this->success(); }); $this->visible(static function (Model $record): bool { if (! method_exists($record, 'trashed')) { return false; } return $record->trashed(); }); } }