Answers for "paginate with laravel variable"

PHP
1

laravel check pagination in blade

@if ($items->hasPages())
    <div class="pagination-wrapper">
         {{ $items->links() }}
    </div>
@endif
Posted by: Guest on November-01-2021
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

Browse Popular Code Answers by Language