|
| 1 | +@if ($paginator->hasPages()) |
| 2 | + <nav role="navigation" aria-label="Pagination Navigation"> |
| 3 | + <ul class="flex justify-center text-sm"> |
| 4 | + {{-- Previous Page Link --}} |
| 5 | + @if ($paginator->onFirstPage()) |
| 6 | + <li aria-label="@lang('pagination.previous')"> |
| 7 | + <span class="px-4 py-3 text-gray-500 block border border-r-0 border-gray-300 rounded-l" aria-hidden="true">←</span> |
| 8 | + </li> |
| 9 | + @else |
| 10 | + <li> |
| 11 | + <a href="{{ $paginator->previousPageUrl() }}" |
| 12 | + rel="prev" |
| 13 | + class="px-4 py-3 block text-blue-900 border border-r-0 border-gray-300 rounded-l hover:text-white hover:bg-blue-900 focus:outline-none focus:shadow-outline" |
| 14 | + aria-label="@lang('pagination.previous')" |
| 15 | + > |
| 16 | + ← |
| 17 | + </a> |
| 18 | + </li> |
| 19 | + @endif |
| 20 | + |
| 21 | + {{-- Pagination Elements --}} |
| 22 | + @foreach ($elements as $element) |
| 23 | + {{-- "Three Dots" Separator --}} |
| 24 | + @if (is_string($element)) |
| 25 | + <li aria-disabled="true"> |
| 26 | + <span class="px-4 py-3 block text-gray-500 border border-r-0 border-gray-300">{{ $element }}</span> |
| 27 | + </li> |
| 28 | + @endif |
| 29 | + |
| 30 | + {{-- Array Of Links --}} |
| 31 | + @if (is_array($element)) |
| 32 | + @foreach ($element as $page => $url) |
| 33 | + @if ($page == $paginator->currentPage()) |
| 34 | + <li aria-current="page"> |
| 35 | + <span class="px-4 py-3 block text-white bg-blue-900 border border-r-0 border-gray-300">{{ $page }}</span> |
| 36 | + </li> |
| 37 | + @else |
| 38 | + <li> |
| 39 | + <a href="{{ $url }}" |
| 40 | + class="px-4 py-3 block text-blue-900 border border-r-0 border-gray-300 hover:text-white hover:bg-blue-900 focus:outline-none focus:shadow-outline" |
| 41 | + aria-label="@lang('pagination.goto_page', ['page' => $page])" |
| 42 | + > |
| 43 | + {{ $page }} |
| 44 | + </a> |
| 45 | + </li> |
| 46 | + @endif |
| 47 | + @endforeach |
| 48 | + @endif |
| 49 | + @endforeach |
| 50 | + |
| 51 | + {{-- Next Page Link --}} |
| 52 | + @if ($paginator->hasMorePages()) |
| 53 | + <li> |
| 54 | + <a href="{{ $paginator->nextPageUrl() }}" |
| 55 | + rel="next" |
| 56 | + class="px-4 py-3 block text-blue-900 border border-gray-300 rounded-r hover:text-white hover:bg-blue-900 focus:outline-none focus:shadow-outline" |
| 57 | + aria-label="@lang('pagination.next')" |
| 58 | + > |
| 59 | + → |
| 60 | + </a> |
| 61 | + </li> |
| 62 | + @else |
| 63 | + <li aria-disabled="true" aria-label="@lang('pagination.next')"> |
| 64 | + <span class="px-4 py-3 block text-gray-500 border border-gray-300 rounded-r" aria-hidden="true">→</span> |
| 65 | + </li> |
| 66 | + @endif |
| 67 | + </ul> |
| 68 | + </nav> |
| 69 | +@endif |
0 commit comments