alkhatibdev / inertia-pagination
Laravel Inertia Pagination, is a Laravel package for generating inertia pagination vue component, designed with TailwindCSS.
Installs: 116
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Language:Vue
README
Introduction
Laravel Inertia Pagination, is a Laravel package for generating inertia pagination vue component, designed with TailwindCSS.
Installation
install via composer
composer require alkhatibdev/inertia-pagination
Publish
php artisan vendor:publish --tag=inertia-pagination
Usage
Assume this is your inertia response:
// App\Http\Controllers\PostController public function index() { return Inertia::render('Post/Index', [ 'posts' => Post::select([ "id", "title", "description" ])->paginate(10), ]); }
Within your inertia page, just import IPagination
vue component, then pass your paginated collection links to it.
// resources/js/Pages/Post/Index.vue <script setup> import IPagination from '@/Components/vendor/InertiaPagination/IPagination.vue' defineProps({ posts: Object }) </script> <template> ... <div v-for="post in posts.data" :key="post.id">...</div> <!-- Use component here, and pass the links array --> <IPagination :links="posts.links" /> ... </template>
Customization
Coming soon..
License
Language Switcher is open-sourced software licensed under the MIT license.