diff --git a/app/Http/Livewire/ShowArticles.php b/app/Http/Livewire/ShowArticles.php index 1b24dfb74..9bfa19ea8 100644 --- a/app/Http/Livewire/ShowArticles.php +++ b/app/Http/Livewire/ShowArticles.php @@ -30,6 +30,9 @@ public function mount(): void public function render(): View { $articles = Article::published(); + $tags = Tag::whereHas('articles', function ($query) { + $query->published(); + })->orderBy('name')->get(); if ($this->tag) { $articles->forTag($this->tag); @@ -39,6 +42,7 @@ public function render(): View return view('livewire.show-articles', [ 'articles' => $articles->paginate(10), + 'tags' => $tags, 'selectedTag' => $this->tag, 'selectedSortBy' => $this->sortBy, ]); diff --git a/resources/views/livewire/show-articles.blade.php b/resources/views/livewire/show-articles.blade.php index 67d830cdf..fe069033a 100644 --- a/resources/views/livewire/show-articles.blade.php +++ b/resources/views/livewire/show-articles.blade.php @@ -27,13 +27,13 @@
- + {{ $article->author()->name() }}
@@ -75,6 +75,13 @@ + + Create Article + +