availableSptVersions = SptVersion::select(['id', 'version', 'color_class'])->orderByDesc('version')->get(); $this->sptVersion = $this->getLatestMinorVersions()->pluck('version')->toArray(); } /** * Get all hotfix versions of the latest minor SPT version. */ public function getLatestMinorVersions(): Collection { return $this->availableSptVersions->filter(function (SptVersion $sptVersion) { return $sptVersion->isLatestMinor(); }); } /** * The component mount method. */ public function render(): View { // Fetch the mods using the filters saved to the component properties. $filters = [ 'query' => $this->query, 'featured' => $this->featured, 'order' => $this->order, 'sptVersion' => $this->sptVersion, ]; $mods = (new ModFilter($filters))->apply()->paginate(24); return view('livewire.mod.index', compact('mods')); } /** * The method to reset the filters. */ public function resetFilters(): void { $this->query = ''; $this->order = 'created'; $this->sptVersion = $this->getLatestMinorVersions()->pluck('version')->toArray(); $this->featured = 'include'; } }