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.
This commit is contained in:
Refringe 2024-10-06 20:19:48 -06:00
parent 70462eaae5
commit 348e7aa532
Signed by: Refringe
SSH Key Fingerprint: SHA256:t865XsQpfTeqPRBMN2G6+N8wlDjkgUCZF3WGW6O9N/k

View File

@ -9,6 +9,7 @@ use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\Cache; use Illuminate\Support\Facades\Cache;
use Livewire\Attributes\Computed; use Livewire\Attributes\Computed;
use Livewire\Attributes\Session;
use Livewire\Attributes\Url; use Livewire\Attributes\Url;
use Livewire\Component; use Livewire\Component;
use Livewire\WithPagination; use Livewire\WithPagination;
@ -20,24 +21,28 @@ class Listing extends Component
/** /**
* The search query value. * The search query value.
*/ */
#[Session]
#[Url] #[Url]
public string $query = ''; public string $query = '';
/** /**
* The sort order value. * The sort order value.
*/ */
#[Session]
#[Url] #[Url]
public string $order = 'created'; public string $order = 'created';
/** /**
* The SPT versions filter value. * The SPT versions filter value.
*/ */
#[Session]
#[Url] #[Url]
public array $sptVersions = []; public array $sptVersions = [];
/** /**
* The featured filter value. * The featured filter value.
*/ */
#[Session]
#[Url] #[Url]
public string $featured = 'include'; public string $featured = 'include';