mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
Mod Filter - Redirect To Last Page
If the page you're on doesn't have any results, then redirect to the last page that does.
This commit is contained in:
parent
1783a683ed
commit
4b3d04ff54
@ -88,6 +88,11 @@ class Index extends Component
|
|||||||
];
|
];
|
||||||
$mods = (new ModFilter($filters))->apply()->paginate(16);
|
$mods = (new ModFilter($filters))->apply()->paginate(16);
|
||||||
|
|
||||||
|
// Check if the current page is greater than the last page. Redirect if it is.
|
||||||
|
if ($mods->currentPage() > $mods->lastPage()) {
|
||||||
|
$this->redirectRoute('mods', ['page' => $mods->lastPage()]);
|
||||||
|
}
|
||||||
|
|
||||||
return view('livewire.mod.index', compact('mods'));
|
return view('livewire.mod.index', compact('mods'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user