I have a situation where i want to implement multiple pagination in single page using laravel paginate() function.
code in Controller file.
$products=Product::paginate(10);
$users=Users::paginate(10);
return view('index',['products' => $products, 'users' => $users ]);
code in my view blade file.
{{ $products->links(); }}
{{ $users->links(); }}
Now when I click on user pagination than the product also show from current page only..
I am using laravel 5.7 can someone tell me how can I use multiple paginations in a single page.
Thanks in advance.
Yes its because by default pagination url with
pageTo Change just pass few extra parametes to
paginatemethodFROM
TO
And here is the Pagination function
https://github.com/laravel/framework/blob/dfa006b884e4ca2952eeab1af7ecd151c0220db7/src/Illuminate/Database/Eloquent/Builder.php#L742
Hope its helps