Arjun Narale Arjun Narale - 3 months ago 19
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

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;" >
            <p></p>
            {!! with(new Illuminate\Pagination\BootstrapThreePresenter($users))->render()!!}
        </div>