onHub($request)) { return redirect($this->hubBase().'/changelog', 301); } DomainAssetContext::applyWebDomainConfig('pressekonto'); return view('web.changelog', [ 'entries' => $this->timeline->entries(), 'feedUrl' => $this->hubBase().'/changelog/feed', ]); } public function feed(Request $request): Response|RedirectResponse { if (! $this->onHub($request)) { return redirect($this->hubBase().'/changelog/feed', 301); } $base = $this->hubBase(); $entries = $this->timeline->entries(50); $items = $entries->map(fn (ChangelogEntry $entry): array => [ 'title' => $entry->category->label().': '.Str::limit($entry->publicText(), 90), 'link' => $base.'/changelog#eintrag-'.$entry->id, 'published_at' => $entry->released_on->copy()->setTime(12, 0)->toRfc2822String(), 'description' => $entry->publicText(), 'category' => $entry->category->label(), 'creator' => null, ])->all(); $xml = view('web.feed', [ 'channel' => [ 'title' => 'pressekonto – Changelog', 'link' => $base.'/changelog', 'self' => $base.'/changelog/feed', 'description' => 'Neuerungen auf pressekonto, presseecho und businessportal24.', 'language' => 'de', 'last_build' => ($entries->first()?->released_on?->copy()->setTime(12, 0) ?? Carbon::now())->toRfc2822String(), ], 'items' => $items, ])->render(); return response($xml, 200, ['Content-Type' => 'application/rss+xml; charset=UTF-8']); } private function onHub(Request $request): bool { return str_contains($request->getHost(), 'pressekonto'); } private function hubBase(): string { return rtrim((string) config('domains.domain_portal_url'), '/'); } }