Looking to hire Laravel developers? Try LaraJobs

laravel-components maintained by amir-hossein5

Description
laravel-components
Author
Last update
2022/04/18 19:01 (2.x-dev)
License
Links
Downloads
12

Comments
comments powered by Disqus

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.

Prerequisites

  • Laravel 8
  • PHP 8

Installation

composer require amir-hossein5/laravel-components

Components

Pagination

Directive:

<x-pagination::theme-name :elems="$users" 

Styles:

...
    @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" 
/>

Themes

Pagination

  • light

  • gray

  • light-circled

  • gray-circled

  • light-underlined

  • red-pill

Modification

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

License

License