Skip to content

Instantly share code, notes, and snippets.

@dzava
Created January 31, 2017 02:03
Show Gist options
  • Save dzava/9819f2df19c1b4e1cc00973516bd5f11 to your computer and use it in GitHub Desktop.
Save dzava/9819f2df19c1b4e1cc00973516bd5f11 to your computer and use it in GitHub Desktop.
Laravel bulma pagination
@if ($paginator->hasPages())
<nav class="pagination">
<a href="{{ $paginator->previousPageUrl() }}"
class="pagination-previous {{ $paginator->onFirstPage() ? 'is-disabled': '' }}">
Previous
</a>
<a href="{{ $paginator->nextPageUrl() }}"
class="pagination-next {{ !$paginator->hasMorePages() ? 'is-disabled': '' }}">
Next
</a>
<ul class="pagination-list">
@foreach ($elements as $element)
@if (is_string($element))
<li><span class="pagination-ellipsis">&hellip;</span></li>
@endif
@if (is_array($element))
@foreach ($element as $page => $url)
<li>
<a href="{{ $url }}"
class="pagination-link {{ $page == $paginator->currentPage() ? 'is-current' : '' }}">
{{ $page }}
</a>
</li>
@endforeach
@endif
@endforeach
</ul>
</nav>
@endif
@aliaqdas07
Copy link

What is the $elements variable in this ?

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