label(__('filament-support::actions/restore.multiple.label')); $this->modalHeading(fn (): string => __('filament-support::actions/restore.multiple.modal.heading', ['label' => $this->getPluralModelLabel()])); $this->modalButton(__('filament-support::actions/restore.multiple.modal.actions.restore.label')); $this->successNotificationTitle(__('filament-support::actions/restore.multiple.messages.restored')); $this->color('secondary'); $this->icon('heroicon-s-reply'); $this->requiresConfirmation(); $this->action(function (): void { $this->process(static function (Collection $records): void { $records->each(function (Model $record): void { if (! method_exists($record, 'restore')) { return; } $record->restore(); }); }); $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']); }); } }