125 lines
7.4 KiB
PHP
125 lines
7.4 KiB
PHP
|
@if ($paginator->hasPages())
|
||
|
{{-- <nav>
|
||
|
<ul class="pagination">
|
||
|
<!-- Previous Page Link -->
|
||
|
@if ($paginator->onFirstPage())
|
||
|
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
|
||
|
<span class="page-link" aria-hidden="true">‹</span>
|
||
|
</li>
|
||
|
@else
|
||
|
<li class="page-item">
|
||
|
<a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">‹</a>
|
||
|
</li>
|
||
|
@endif
|
||
|
|
||
|
<!-- Pagination Elements -->
|
||
|
@foreach ($elements as $element)
|
||
|
<!-- "Three Dots" Separator -->
|
||
|
@if (is_string($element))
|
||
|
<li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
|
||
|
@endif
|
||
|
|
||
|
<!-- Array Of Links -->
|
||
|
@if (is_array($element))
|
||
|
@foreach ($element as $page => $url)
|
||
|
@if ($page == $paginator->currentPage())
|
||
|
<li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>
|
||
|
@else
|
||
|
<li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
|
||
|
@endif
|
||
|
@endforeach
|
||
|
@endif
|
||
|
@endforeach
|
||
|
|
||
|
<!-- Next Page Link -->
|
||
|
@if ($paginator->hasMorePages())
|
||
|
<li class="page-item">
|
||
|
<a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">›</a>
|
||
|
</li>
|
||
|
@else
|
||
|
<li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
|
||
|
<span class="page-link" aria-hidden="true">›</span>
|
||
|
</li>
|
||
|
@endif
|
||
|
</ul>
|
||
|
</nav> --}}
|
||
|
@if ($paginator->onFirstPage())
|
||
|
<a href="{{ $paginator->toArray()['first_page_url'] }}" class="page-link page-item disabled btn btn-icon btn-sm btn-light-primary mr-2 my-1">
|
||
|
<i class="ki ki-bold-double-arrow-back icon-xs"></i>
|
||
|
</a>
|
||
|
<a href="#" class="page-link page-item disabled btn btn-icon btn-sm btn-light-primary mr-2 my-1" aria-disabled="true" aria-label="@lang('pagination.previous')">
|
||
|
<i class="ki ki-bold-arrow-back icon-xs"></i>
|
||
|
</a>
|
||
|
@else
|
||
|
<a href="{{ $paginator->toArray()['first_page_url'] }}" class="page-link btn btn-icon btn-sm btn-light-primary mr-2 my-1">
|
||
|
<i class="ki ki-bold-double-arrow-back icon-xs"></i>
|
||
|
</a>
|
||
|
<a href="{{ $paginator->previousPageUrl() }}" class="page-link btn btn-icon btn-sm btn-light-primary mr-2 my-1" aria-label="@lang('pagination.previous')">
|
||
|
<i class="ki ki-bold-arrow-back icon-xs"></i>
|
||
|
</a>
|
||
|
@endif
|
||
|
<!-- Pagination Elements -->
|
||
|
@foreach ($elements as $element)
|
||
|
{{-- <!-- "Three Dots" Separator -->
|
||
|
@if (is_string($element))
|
||
|
<a href="#" class="page-item disabled page-link btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-disabled="true">{{ $element }}</a>
|
||
|
@endif --}}
|
||
|
<!-- Array Of Links -->
|
||
|
@if (is_array($element))
|
||
|
@foreach ($element as $page => $url)
|
||
|
<!-- Use three dots when current page is greater than 4. -->
|
||
|
@if ($paginator->currentPage() > 4 && $page === 2)
|
||
|
<a href="#" class="page-item disabled btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-disabled="true"><span class="page-link">...</span></a>
|
||
|
@endif
|
||
|
<!-- Show active page else show the first and last two pages from current page. -->
|
||
|
@if ($page == $paginator->currentPage())
|
||
|
<a href="#" class="page-item btn btn-icon btn-sm border-0 btn-hover-primary active mr-2 my-1" aria-current="page">{{ $page }}</a>
|
||
|
@elseif ($page === $paginator->currentPage() + 1 || $page === $paginator->currentPage() + 2 || $page === $paginator->currentPage() - 1 || $page === $paginator->currentPage() - 2 || $page === $paginator->lastPage() || $page === 1)
|
||
|
<a href="{{ $url }}" class="page-item page-link btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1">{{ $page }}</a>
|
||
|
@endif
|
||
|
<!-- Use three dots when current page is away from end. -->
|
||
|
@if ($paginator->currentPage() < $paginator->lastPage() - 3 && $page === $paginator->lastPage() - 1)
|
||
|
<a href="#" class="page-item disabled btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-disabled="true"><span class="page-link">...</span></a>
|
||
|
@endif
|
||
|
@endforeach
|
||
|
@endif
|
||
|
@endforeach
|
||
|
{{-- @if($paginator->currentPage() > 3)
|
||
|
<a href="{{ $paginator->url(1) }}" class="page-item btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-current="page">1</a>
|
||
|
@endif
|
||
|
@if($paginator->currentPage() > 4)
|
||
|
<a href="#" class="page-item disabled page-link btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-disabled="true">...</a>
|
||
|
@endif
|
||
|
@foreach(range(1, $paginator->lastPage()) as $i)
|
||
|
@if($i >= $paginator->currentPage() - 2 && $i <= $paginator->currentPage() + 2)
|
||
|
@if ($i == $paginator->currentPage())
|
||
|
<a href="#" class="page-item btn btn-icon btn-sm border-0 btn-hover-primary active mr-2 my-1" aria-current="page">{{ $i }}</a>
|
||
|
@else
|
||
|
<a href="{{ $paginator->url($i) }}" class="page-item page-link btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1">{{ $page }}</a>
|
||
|
@endif
|
||
|
@endif
|
||
|
@endforeach
|
||
|
@if($paginator->currentPage() < $paginator->lastPage() - 3)
|
||
|
<a href="#" class="page-item disabled page-link btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-disabled="true">...</a>
|
||
|
@endif
|
||
|
@if($paginator->currentPage() < $paginator->lastPage() - 2)
|
||
|
<a href="{{ $paginator->url($paginator->lastPage()) }}" class="page-item btn btn-icon btn-sm border-0 btn-hover-primary mr-2 my-1" aria-current="page">{{ $paginator->lastPage() }}</a>
|
||
|
@endif --}}
|
||
|
<!-- Next Page Link -->
|
||
|
@if ($paginator->hasMorePages())
|
||
|
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="page-item page-link btn btn-icon btn-sm btn-light-primary mr-2 my-1" aria-label="@lang('pagination.next')">
|
||
|
<i class="ki ki-bold-arrow-next icon-xs"></i>
|
||
|
</a>
|
||
|
<a href="{{ $paginator->toArray()['last_page_url'] }}" class="page-item page-link btn btn-icon btn-sm btn-light-primary mr-2 my-1">
|
||
|
<i class="ki ki-bold-double-arrow-next icon-xs"></i>
|
||
|
</a>
|
||
|
@else
|
||
|
<a href="{{ $paginator->nextPageUrl() }}" rel="next" class="page-item disabled page-link btn btn-icon btn-sm btn-light-primary mr-2 my-1" aria-disabled="true" aria-label="@lang('pagination.next')">
|
||
|
<i class="ki ki-bold-arrow-next icon-xs"></i>
|
||
|
</a>
|
||
|
<a href="{{ $paginator->toArray()['last_page_url'] }}" class="page-item disabled page-link btn btn-icon btn-sm btn-light-primary mr-2 my-1">
|
||
|
<i class="ki ki-bold-double-arrow-next icon-xs"></i>
|
||
|
</a>
|
||
|
@endif
|
||
|
@endif
|