From 5c02d237e354e3be0d62b19a1840b093e79955ce Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Fri, 9 Aug 2024 11:45:37 -0400 Subject: [PATCH] add featured section filter --- app/Livewire/ModIndex.php | 9 ++++++--- resources/views/livewire/mod-index.blade.php | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/app/Livewire/ModIndex.php b/app/Livewire/ModIndex.php index c629654..8510598 100644 --- a/app/Livewire/ModIndex.php +++ b/app/Livewire/ModIndex.php @@ -13,14 +13,17 @@ class ModIndex extends Component public $modSearch = ''; - public $sectionFilter = 'new'; + public $sectionFilter = 'featured'; public function render() { - // 'new' section is default - $section = 'created_at'; + // 'featured' section is default + $section = 'featured'; switch ($this->sectionFilter) { + case 'new': + $section = 'created_at'; + break; case 'most_downloaded': $section = 'total_downloads'; break; diff --git a/resources/views/livewire/mod-index.blade.php b/resources/views/livewire/mod-index.blade.php index 3be079b..40f0943 100644 --- a/resources/views/livewire/mod-index.blade.php +++ b/resources/views/livewire/mod-index.blade.php @@ -32,7 +32,11 @@ {{-- section filters --}}