myvideogamelist.com/resources/views/partials/general/_pagination.blade.php
Jimmy Brancaccio b39ecf1638 Initial Commit
The initial public commit of MVGL website code.
2024-01-14 13:51:43 -06:00

40 lines
1.8 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@if ($paginator->hasPages())
<ul class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<li class="page-item previous disabled"><a href="#" class="page-link"><i class="previous"></i></a></li>
@else
<li class="page-item previous"><a href="{{ PaginateRoute::previousPageUrl() }}" class="page-link"><i class="previous"></i></a></li>
@endif
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<li class="disabled page-item"><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"><span class="page-link">{{ $page }}</span></li>
@else
@if (in_array($paginator->currentPage(), [$page - 1, $page, $page + 1]))
<li class="page-item"><a class="page-link" href="{{ PaginateRoute::pageUrl($page) }}">{{ $page }}</a></li>
@else
<li class="page-item hidden-xs"><a class="page-link" href="{{ PaginateRoute::pageUrl($page) }}">{{ $page }}</a></li>
@endif
@endif
@endforeach
@endif
@endforeach
{{-- Next Page Link --}}
@if ($paginator->hasMorePages())
<li class="page-item next"><a href="{{ PaginateRoute::nextPageUrl($paginator) }}" class="page-link"><i class="next"></i></a></li>
@else
<li class="page-item disabled"><span class="page-link"></span></li>
@endif
</ul>
@endif