default.blade.php 1.8 KB

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