label(__('filament-actions::delete.single.label')); $this->modalHeading(fn (): string => __('filament-actions::delete.single.modal.heading', ['label' => $this->getRecordTitle()])); $this->modalSubmitActionLabel(__('filament-actions::delete.single.modal.actions.delete.label')); $this->successNotificationTitle(__('filament-actions::delete.single.notifications.deleted.title')); $this->color('danger'); $this->groupedIcon('heroicon-m-trash'); $this->requiresConfirmation(); $this->modalIcon('heroicon-o-trash'); $this->keyBindings(['mod+d']); $this->hidden(static function (Model $record): bool { if (! method_exists($record, 'trashed')) { return false; } return $record->trashed(); }); $this->action(function (): void { $result = $this->process(static fn (Model $record) => $record->delete()); if (! $result) { $this->failure(); return; } $this->success(); }); } }