bootstrap-4.blade.php-- 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @if ($paginator->hasPages())
  2. <nav>
  3. <ul class="pagination">
  4. {{-- Previous Page Link --}}
  5. @if ($paginator->onFirstPage())
  6. <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
  7. <span class="page-link" aria-hidden="true">&lsaquo;</span>
  8. </li>
  9. @else
  10. <li class="page-item">
  11. <a class="page-link" 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="page-item disabled" aria-disabled="true"><span class="page-link">{{ $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="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>
  25. @else
  26. <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
  27. @endif
  28. @endforeach
  29. @endif
  30. @endforeach
  31. {{-- Next Page Link --}}
  32. @if ($paginator->hasMorePages())
  33. <li class="page-item">
  34. <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</a>
  35. </li>
  36. @else
  37. <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
  38. <span class="page-link" aria-hidden="true">&rsaquo;</span>
  39. </li>
  40. @endif
  41. </ul>
  42. </nav>
  43. @endif