Skip to content

Instantly share code, notes, and snippets.

@cursosdesarrolloweb
Created November 4, 2020 09:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cursosdesarrolloweb/89e818858f3ca4093a738e5e3ed5d975 to your computer and use it in GitHub Desktop.
Save cursosdesarrolloweb/89e818858f3ca4093a738e5e3ed5d975 to your computer and use it in GitHub Desktop.
{{-- Array Of Links --}}
@if (is_array($element))
@foreach ($element as $page => $url)
@if ($page >= $paginator->currentPage() - 2 && $page <= $paginator->currentPage() + 2)
@if ($page == $paginator->currentPage())
<span aria-current="page">
<span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5">{{ $page }}</span>
</span>
@else
<a href="{{ $url }}" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
{{ $page }}
</a>
@endif
@endif
@endforeach
@endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment