bootstrap-5.blade.php 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. @if ($paginator->hasPages())
  2. <nav class="d-flex justify-items-center justify-content-between">
  3. <div class="d-flex justify-content-between flex-fill d-sm-none">
  4. <ul class="pagination">
  5. {{-- Previous Page Link --}}
  6. @if ($paginator->onFirstPage())
  7. <li class="page-item disabled" aria-disabled="true">
  8. <span class="page-link">@lang('pagination.previous')</span>
  9. </li>
  10. @else
  11. <li class="page-item">
  12. <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a>
  13. </li>
  14. @endif
  15. {{-- Next Page Link --}}
  16. @if ($paginator->hasMorePages())
  17. <li class="page-item">
  18. <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a>
  19. </li>
  20. @else
  21. <li class="page-item disabled" aria-disabled="true">
  22. <span class="page-link">@lang('pagination.next')</span>
  23. </li>
  24. @endif
  25. </ul>
  26. </div>
  27. <div class="d-none flex-sm-fill d-sm-flex align-items-sm-center justify-content-sm-between">
  28. <div>
  29. <p class="small text-muted">
  30. {!! __('Showing') !!}
  31. <span class="font-medium">{{ $paginator->firstItem() }}</span>
  32. {!! __('to') !!}
  33. <span class="font-medium">{{ $paginator->lastItem() }}</span>
  34. {!! __('of') !!}
  35. <span class="font-medium">{{ $paginator->total() }}</span>
  36. {!! __('results') !!}
  37. </p>
  38. </div>
  39. <div>
  40. <ul class="pagination">
  41. {{-- Previous Page Link --}}
  42. @if ($paginator->onFirstPage())
  43. <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.previous')">
  44. <span class="page-link" aria-hidden="true">&lsaquo;</span>
  45. </li>
  46. @else
  47. <li class="page-item">
  48. <a class="page-link" href="{{ $paginator->previousPageUrl() }}" rel="prev" aria-label="@lang('pagination.previous')">&lsaquo;</a>
  49. </li>
  50. @endif
  51. {{-- Pagination Elements --}}
  52. @foreach ($elements as $element)
  53. {{-- "Three Dots" Separator --}}
  54. @if (is_string($element))
  55. <li class="page-item disabled" aria-disabled="true"><span class="page-link">{{ $element }}</span></li>
  56. @endif
  57. {{-- Array Of Links --}}
  58. @if (is_array($element))
  59. @foreach ($element as $page => $url)
  60. @if ($page == $paginator->currentPage())
  61. <li class="page-item active" aria-current="page"><span class="page-link">{{ $page }}</span></li>
  62. @else
  63. <li class="page-item"><a class="page-link" href="{{ $url }}">{{ $page }}</a></li>
  64. @endif
  65. @endforeach
  66. @endif
  67. @endforeach
  68. {{-- Next Page Link --}}
  69. @if ($paginator->hasMorePages())
  70. <li class="page-item">
  71. <a class="page-link" href="{{ $paginator->nextPageUrl() }}" rel="next" aria-label="@lang('pagination.next')">&rsaquo;</a>
  72. </li>
  73. @else
  74. <li class="page-item disabled" aria-disabled="true" aria-label="@lang('pagination.next')">
  75. <span class="page-link" aria-hidden="true">&rsaquo;</span>
  76. </li>
  77. @endif
  78. </ul>
  79. </div>
  80. </div>
  81. </nav>
  82. @endif