columns([ TextColumn::make('id')->label('Nr.'), TextColumn::make('created_at')->label('Gespeichert')->dateTime('d.m.Y H:i'), TextColumn::make('author.name')->label('Von'), TextColumn::make('published') ->label('Live') ->state(fn (PageRevision $record): string => $record->id === $this->getOwnerRecord()->published_revision_id ? 'Ja' : 'Nein'), ]) ->recordActions([ Action::make('publish') ->label('Veröffentlichen') ->requiresConfirmation() ->visible(fn (): bool => auth()->user()?->can('publish', $this->getOwnerRecord()) ?? false) ->action(function (PageRevision $record, PageService $service): void { $service->publish($this->getOwnerRecord(), $record); $this->getOwnerRecord()->refresh(); }), Action::make('restore') ->label('Wiederherstellen') ->requiresConfirmation() ->modalDescription('Es entsteht eine neue Revision. Die Live-Seite bleibt unverändert, bis sie veröffentlicht wird.') ->action(function (PageRevision $record, PageService $service): void { $service->restore($this->getOwnerRecord(), $record, auth()->user()); }), ]) ->defaultSort('id', 'desc'); } }