Answers for "laravel returning http paginated links"

PHP
3

laravel pagination with get parameters

Suppose $users is a paginated eloquent collection

$users = User::paginate(10);

You can append attributes to the pagination links;

{{ $users->appends(['sort' => 'votes'])->links() }}

This would result in a url like /users?page=2&sort=votes

You can get the total record count with $users->total()
Posted by: Guest on November-22-2020
0

Customize laravel pagination links

{{ $users->onEachSide(5)->links() }}
Posted by: Guest on September-28-2021

Code answers related to "laravel returning http paginated links"

Browse Popular Code Answers by Language