-
app/View/Components/SeriesNextPostComponent.php
Open in GitHubuse App\Models\Post; use Illuminate\View\Component; class SeriesNextPostComponent extends Component { public function render() { $nextPost = Post::query() ->where('series_slug', $this->post->series_slug) ->where('id', '>', $this->post->id) ->orderBy('id') ->first(); return view('components.series-next-post-component', compact('nextPost')); } }
-
resources/views/components/series-next-post-component.blade.php
Open in GitHub@if ($nextPost) This series is continued in <a href="{{ route('post', $nextPost->slug) }}">{{ lcfirst($nextPost->series_toc_title) }}</a>. @endif