Answer the question
In order to leave comments, you need to log in
How to make pagination for request with parameters in laravel?
There is a request:
$poisks = DB::table('items')
->where('brand',$brand)
->where('location',$location)
->whereIn('fuel_type',[$fuel_type])
->whereBetween('price', [$price_from, $price_to])
->whereIn('body_type', [$body_type])
->whereIn('fuel_type', [$fuel_type])
->whereIn('model', [$model])
->paginate(10);
$_POST.
Answer the question
In order to leave comments, you need to log in
If I understand you, you can simply call the method appends($request->query())
on the collection.
For example, in your case:
$poisks = DB::table('items')
->where('brand',$brand)
->where('location',$location)
->whereIn('fuel_type',[$fuel_type])
->whereBetween('price', [$price_from, $price_to])
->whereIn('body_type', [$body_type])
->whereIn('fuel_type', [$fuel_type])
->whereIn('model', [$model])
->paginate(10)
->appends($request->query());
{{ $poisks->links() }}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question