Level 102
There is a bullt in method for it
$competitions = Competition::orderBy('id', 'DESC')->paginate(2)->withQueryString();
I've got a problem with pagination and one way to fix it is to use appends(request()->query())
$competitions = Competition::orderBy('id', 'DESC')->paginate(2)->appends(request()->query());
But the problem now is that it makes the URL really weird. When you go back and forth it stack up the pages like this http://local:8003/competitions?%2F%2Fcompetitions%3F%2F%2Fcompetitions%3F%2F%2Fcompetitions%3F%2F%2Fcompetitions%3Fpage=2&page=3
Any and all help gratefully received!
Please or to participate in this conversation.