Answer the question
In order to leave comments, you need to log in
How to change pagination in Laravel 5.1?
I'm using laravel's standard paging output. {!! $users->render() !!}
laravel generates the following:
<ul class="pagination">
<li>
<a href="http://test.ru/users/?page=1" rel="prev">«</a></li>
<li><a href="http://test.ru/users/?page=1">1</a></li>
<li class="active"><span>2</span></li>
<li class="disabled"><span>»</span>
</li>
</ul>
test.ru/users/?page=1
test.ru/users
test.ru/usersand
test.ru/users/?page=1
Answer the question
In order to leave comments, you need to log in
It would be correct to make your own Paginator, inherit it from Illuminate\Pagination\Paginator
or Illuminate\Pagination\LengthAwarePaginator
, and url()
add a check for the first page output in the method. But then you will have to create the paginator manually, passing the necessary parameters to it.
It is strange that in Illuminate\Database\Eloquent\Builder
Paginator it is called directly, and not through DI, this would solve all the problems.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question