requiresConfirmation(); $this->label(__('filament-actions::delete.multiple.label')); $this->modalHeading(fn (): string => __('filament-actions::delete.multiple.modal.heading', ['label' => $this->getPluralModelLabel()])); $this->modalSubmitActionLabel(__('filament-actions::delete.multiple.modal.actions.delete.label')); $this->successNotificationTitle(__('filament-actions::delete.multiple.notifications.deleted.title')); $this->defaultColor('danger'); $this->icon(FilamentIcon::resolve('actions::delete-action') ?? 'heroicon-m-trash'); $this->modalIcon(FilamentIcon::resolve('actions::delete-action.modal') ?? 'heroicon-o-trash'); $this->action(function (): void { $this->process(static fn (Collection $records) => $records->each(fn (Model $record) => $record->delete())); $this->success(); }); $this->deselectRecordsAfterCompletion(); $this->hidden(function (HasTable $livewire): bool { $trashedFilterState = $livewire->getTableFilterState(TrashedFilter::class) ?? []; if (! array_key_exists('value', $trashedFilterState)) { return false; } if ($trashedFilterState['value']) { return false; } return filled($trashedFilterState['value']); }); } }