Skip to content

Instantly share code, notes, and snippets.

@depsimon
Created July 16, 2017 14:37
Show Gist options
  • Save depsimon/24b3899d8c34c2d4cf34266b518913de to your computer and use it in GitHub Desktop.
Save depsimon/24b3899d8c34c2d4cf34266b518913de to your computer and use it in GitHub Desktop.
Laravel Bulma Pagination Template
@if ($paginator->hasPages())
<nav class="pagination">
{{-- Previous Page Link --}}
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</li>
@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
<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">{{ $element }}</span></li>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<li><span class="pagination-link is-current">{{ $page }}</span></li>
@else
<li><a href="{{ $url }}" class="pagination-link">{{ $page }}</a></li>
@endif
@endforeach
@endif
@endforeach
</ul>
@endif
@keevitaja
Copy link

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment