Skip to content

Instantly share code, notes, and snippets.

@webber12
Created July 20, 2023 22:32
Show Gist options
  • Save webber12/4dc88a08e32f500b58038affa16bd18e to your computer and use it in GitHub Desktop.
Save webber12/4dc88a08e32f500b58038affa16bd18e to your computer and use it in GitHub Desktop.
paginator
<div class="row">
<div class="col-sm-12 col-md-5">
<div class="dataTables_info">Показано {{ $paginator->firstItem() }} - {{ $paginator->lastItem() }} из {{ $paginator->total() }}</div>
</div>
<div class="col-sm-12 col-md-7">
@if($paginator->hasPages())
<div class="dataTables_paginate paging_simple_numbers" >
<ul class="pagination">
@if(!$paginator->onFirstPage())
<li class="paginate_button page-item previous">
<a href="{{ Str::replace([ '&page=1', 'page=1' ], '', $paginator->previousPageUrl()) }}" class="page-link">Назад</a>
</li>
@else
<li class="paginate_button page-item previous disabled">
<a href="#" class="page-link">Назад</a>
</li>
@endif
@for($page = 1; $page <= $paginator->lastPage(); $page++)
<li class="paginate_button page-item @if($paginator->currentPage() == $page) active @endif ">
<a href="{{ Str::replace([ '&page=1', 'page=1' ], '', $paginator->url($page)) }}" class="page-link">{{ $page }}</a>
</li>
@endfor
@if($paginator->hasMorePages())
<li class="paginate_button page-item next ">
<a href="{{ $paginator->nextPageUrl() }}" class="page-link">Далее</a>
</li>
@else
<li class="paginate_button page-item next disabled">
<a href="#" class="page-link">Далее</a>
</li>
@endif
</ul>
</div>
@endif
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment