label(fn (): string => $this->primaryRelatedEntry()?->actionLabel ?? 'Open related record') ->url(fn (): ?string => $this->primaryRelatedEntry()?->targetUrl) ->hidden(fn (): bool => ! ($this->primaryRelatedEntry()?->isAvailable() ?? false)) ->color('gray'), ]; } public function getFooter(): ?View { return view('filament.resources.policy-version-resource.pages.view-policy-version-footer', [ 'record' => $this->getRecord(), ]); } private function primaryRelatedEntry(bool $fresh = false): ?RelatedContextEntry { $resolver = app(RelatedNavigationResolver::class); return $fresh ? $resolver->primaryListActionFresh(CrossResourceNavigationMatrix::SOURCE_POLICY_VERSION, $this->getRecord()) : $resolver->primaryListAction(CrossResourceNavigationMatrix::SOURCE_POLICY_VERSION, $this->getRecord()); } }