Arjun Narale Arjun Narale - 1 year ago 167
PHP Question

Server side pagination of laravel 5

I am having some trouble implementing server side pagination in Laravel 5.
Do you have any idea please tell

Answer Source

try with this one

//in controller
$users = \App\User::paginate(15)
    return view('your desired view file name', compact('users'));

// in view
      <div class="text-center text-muted" role="status" aria-live="polite">Showing {{$users->firstItem()}} to {{$users->lastItem()}} of {{$users->total()}} entries</div>
        <div style="display:flex;justify-content:center;align-items:center;" >
            {!! with(new Illuminate\Pagination\BootstrapThreePresenter($users))->render()!!}
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download