Created
January 7, 2017 14:56
-
-
Save robbens/a741a5cfe8cd213815e218d4c0d82963 to your computer and use it in GitHub Desktop.
Bulma.io pagination for Laravel
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()) | |
<span class="pagination-previous is-disabled">Previous</span> | |
@else | |
<a class="pagination-previous" href="{{ $paginator->previousPageUrl() }}" rel="prev">Previous</a> | |
@endif | |
{{-- Next Page Link --}} | |
@if ($paginator->hasMorePages()) | |
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next page</a> | |
@else | |
<span class="pagination-next is-disabled">Next page</span> | |
@endif | |
<ul class="pagination-list"> | |
@foreach ($elements as $element) | |
@if (is_string($element)) | |
<li><span class="pagination-ellipsis">…</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 class="pagination-link" href="{{ $url }}">{{ $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