label(__('filament-support::actions/force-delete.multiple.label')); $this->modalHeading(fn (): string => __('filament-support::actions/force-delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()])); $this->modalButton(__('filament-support::actions/force-delete.multiple.modal.actions.delete.label')); $this->successNotificationTitle(__('filament-support::actions/force-delete.multiple.messages.deleted')); $this->color('danger'); $this->icon('heroicon-s-trash'); $this->requiresConfirmation(); $this->action(function (): void { $this->process(static function (Collection $records): void { $records->each(fn (Model $record) => $record->forceDelete()); }); $this->success(); }); $this->deselectRecordsAfterCompletion(); $this->hidden(function (HasTable $livewire): bool { $trashedFilterState = $livewire->getTableFilterState(TrashedFilter::class) ?? []; if (! array_key_exists('value', $trashedFilterState)) { return false; } return blank($trashedFilterState['value']); }); } }