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


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()!!}