-
-
Save KABBOUCHI/c3dd175ba975290776f1dd3ca76714f7 to your computer and use it in GitHub Desktop.
Bulma blade template for Laravel 5.4 pagination
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($paginator->hasPages()) | |
<nav class="pagination is-centered"> | |
@if ($paginator->onFirstPage()) | |
<a class="pagination-previous" disabled>Previous</a> | |
@else | |
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-previous">Previous</a> | |
@endif | |
@if ($paginator->hasMorePages()) | |
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a> | |
@else | |
<a class="pagination-next" disabled>Next page</a> | |
@endif | |
<ul class="pagination-list"> | |
{{-- Pagination Elements --}} | |
@foreach ($elements as $element) | |
{{-- "Three Dots" Separator --}} | |
@if (is_string($element)) | |
<li><span class="pagination-ellipsis"><span>{{ $element }}</span></span></li> | |
@endif | |
{{-- Array Of Links --}} | |
@if (is_array($element)) | |
@foreach ($element as $page => $url) | |
@if ($page == $paginator->currentPage()) | |
<li><a class="pagination-link is-current">{{ $page }}</a></li> | |
@else | |
<li><a href="{{ $url }}" class="pagination-link">{{ $page }}</a></li> | |
@endif | |
@endforeach | |
@endif | |
@endforeach | |
</ul> | |
</nav> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment