This package provides ready to use pagination components using tailwindcss inside (you don't need to have it).
For example instead of :
//Controller
$users = User::paginate(4);
//Blade
{{ $users->links() }}
You may use in blade:
<x-pagination::gray-circled :elems="$users" />
And it previews with gray-circled theme :
But you can change themes and more settings read Usage.
- Laravel 8
- PHP 8
composer require amir-hossein5/laravel-components
<x-pagination::theme-name :elems="$users"
...
@lComponentStyles('pagination')
</head>
All parameters of paginate tag :
parameter | description | default |
---|---|---|
:elems="" | pagination items | |
prev="string" | previous button's html | laravel's default |
next="string" | next button's html | laravel's default |
prevInResponsive="string" | previous button's html in responsive pagination | laravel's default |
nextInResponsive="string" | next button's html in responsive pagination | laravel's default |
:showDisabledButtons="boolean" | show disabled buttons when paginator is on first or last page | depends on theme |
:showPaginatorDetails="boolean" | show text "Showing 4 to 6 of 12 results" or not | true |
class="string" | class for pagination main (parent) tag |
for example:
<x-pagination::light-underlined
:elems="$users"
:showPaginatorDetails="false"
:showDisabledButtons="true"
/>
To modify any component use vendor:publish --tag=componentName-themeName
.
For example for pagination and theme of gray:
php artisan vendor:publish --tag=pagination-gray