paginator.blade.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. @if ($paginator->hasPages())
  2. <ul class="pagination custom" role="navigation">
  3. {{-- Previous Page Link --}}
  4. @if ($paginator->onFirstPage())
  5. <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
  6. <span class="page-link" aria-hidden="true">&lsaquo;</span>
  7. </li>
  8. @else
  9. <li class="page-item">
  10. <span class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</span>
  11. </li>
  12. @endif
  13. {{-- Pagination Elements --}}
  14. @foreach ($elements as $element)
  15. {{-- "Three Dots" Separator --}}
  16. @if (is_string($element))
  17. <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
  18. @endif
  19. {{-- Array Of Links --}}
  20. @if (is_array($element))
  21. @foreach ($element as $page => $url)
  22. @if ($page == $paginator->currentPage())
  23. <li class="page-item active disabled" aria-current="page"><span class="page-link">{{ $page }}</span></li>
  24. @else
  25. <li class="page-item"><span class="page-link" href="{{ $url }}">{{ $page }}</span></li>
  26. @endif
  27. @endforeach
  28. @endif
  29. @endforeach
  30. {{-- Next Page Link --}}
  31. @if ($paginator->hasMorePages())
  32. <li class="page-item">
  33. <span class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</span>
  34. </li>
  35. @else
  36. <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
  37. <span class="page-link" aria-hidden="true">&rsaquo;</span>
  38. </li>
  39. @endif
  40. </ul>
  41. @endif