From 348e7aa532377820cafd7d999373ffd0a21f9676 Mon Sep 17 00:00:00 2001 From: Refringe Date: Sun, 6 Oct 2024 20:19:48 -0600 Subject: [PATCH] Saves Filter Data in Session Adds back in the Session attribute. Apparently if you add it first, before the Url attribute, you can alter the variables in the URL and the changes will stick around. --- app/Livewire/Mod/Listing.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/Livewire/Mod/Listing.php b/app/Livewire/Mod/Listing.php index 422ad0c..5f7bc67 100644 --- a/app/Livewire/Mod/Listing.php +++ b/app/Livewire/Mod/Listing.php @@ -9,6 +9,7 @@ use Illuminate\Contracts\View\View; use Illuminate\Database\Eloquent\Collection; use Illuminate\Support\Facades\Cache; use Livewire\Attributes\Computed; +use Livewire\Attributes\Session; use Livewire\Attributes\Url; use Livewire\Component; use Livewire\WithPagination; @@ -20,24 +21,28 @@ class Listing extends Component /** * The search query value. */ + #[Session] #[Url] public string $query = ''; /** * The sort order value. */ + #[Session] #[Url] public string $order = 'created'; /** * The SPT versions filter value. */ + #[Session] #[Url] public array $sptVersions = []; /** * The featured filter value. */ + #[Session] #[Url] public string $featured = 'include';