prefixes->pluck('slug')->contains($prefix)) { abort(404); } $publications = Publication::published() ->forChannel($channel) ->with(['post.author', 'taxonomyTerms']) ->latest('published_at') ->paginate(12); return response()->view('theme::posts.index', compact('publications', 'prefix')); } public function show(Channel $channel, string $prefix, string $slug): Response { if ($prefix === $channel->taxonomy_slug) { return app(TaxonomyController::class)->show($channel, $slug); } if (!$channel->prefixes->pluck('slug')->contains($prefix)) { abort(404); } $publication = Publication::published() ->forChannel($channel) ->with(['blocks', 'taxonomyTerms', 'post.author']) ->where(fn ($q) => $q->where('slug', $slug)->orWhere('post_id', $slug)) ->firstOrFail(); return response()->view('theme::posts.show', compact('publication', 'prefix')); } }