alkhatibdev/inertia-pagination

Laravel Inertia Pagination, is a Laravel package for generating inertia pagination vue component, designed with TailwindCSS.
155 2
Install
composer require alkhatibdev/inertia-pagination
Latest Version:0.0.1
License:MIT
Last Updated:Nov 30, 2023
Links: GitHub  ·  Packagist
Maintainer: alkhatibdev

Laravel Inertia Pagination

Latest Version MIT Licensed

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.

Related Packages

laravel/breeze

Minimal Laravel authentication scaffolding with Blade and Tailwind.

40,097,748 3,055
ebess/advanced-nova-media-library

Laravel Nova tools for managing the Spatie media library.

3,691,583 616
coroowicaksono/chart-js-integration

A Simple Dashboard Chart in Laravel Nova using Chart JS. Starting create your ow...

2,174,596 217
timothyasp/nova-color-field

A Laravel Nova Color Picker field.

1,802,762 76
dillingham/nova-ajax-select

Nova Ajax Select

1,404,399 86