Skip to content

Instantly share code, notes, and snippets.

@Sopamo
Created February 1, 2017 17:36
Show Gist options
  • Save Sopamo/5efc0739cdef75817fc2ba69617f39a6 to your computer and use it in GitHub Desktop.
Save Sopamo/5efc0739cdef75817fc2ba69617f39a6 to your computer and use it in GitHub Desktop.
A semantic UI pagination template for Laravel 5.3+
@if ($paginator->hasPages())
<div class="ui pagination menu">
{{-- Pagination Elements --}}
@foreach ($elements as $element)
{{-- "Three Dots" Separator --}}
@if (is_string($element))
<div class="disabled item">
{{ $element }}
</div>
@endif
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page == $paginator->currentPage())
<a class="active item">
{{ $page }}
</a>
@else
<a href="{{ $url }}" class="item">
{{ $page }}
</a>
@endif
@endforeach
@endif
@endforeach
</div>
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment