Last active
April 7, 2024 16:02
-
-
Save rchl2/f705e6943af930c65762fe8bcd6978ab to your computer and use it in GitHub Desktop.
Tailwind CSS simple pagination template for Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@if ($paginator->hasPages()) | |
<ul class="pagination flex justify-between mx-4 mt-4 list-reset text-white font-bold"> | |
{{-- Previous Page Link --}} | |
@if ($paginator->onFirstPage()) | |
<li class="disabled"> | |
<span class="button bg-transparent border border-brown py-2 px-4 rounded opacity-50 cursor-not-allowed">@lang('pagination.previous')</span> | |
</li> | |
@else | |
<li> | |
<a class="button bg-transparent border border-brown py-2 px-4 rounded opacity-85" href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a> | |
</li> | |
@endif | |
{{-- Next Page Link --}} | |
@if ($paginator->hasMorePages()) | |
<li> | |
<a class="button bg-transparent border border-brown py-2 px-4 rounded opacity-85" href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a> | |
</li> | |
@else | |
<li class="disabled "> | |
<span class="button bg-transparent border border-brown py-2 px-4 rounded opacity-50 cursor-not-allowed">@lang('pagination.next')</span> | |
</li> | |
@endif | |
</ul> | |
@endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there 👋
I created a TailwindCSS plugin that adds the necessary components for Laravel paginations. 📖
https://github.com/lorisleiva/tailwindcss-plugins/tree/master/pagination
All you need to do is register it:
And it will style the default pagination template from Laravel.
I hope this helps someone. 🍀