svnwa/inertiavuepaginator

:package_description
15,918 31
Install
composer require svnwa/inertiavuepaginator
Latest Version:1.0
License:MIT
Last Updated:Aug 31, 2022
Links: GitHub  ·  Packagist
Maintainer: svnwa

InertiaVuePaginator

Latest Version on Packagist Total Downloads

These are two basic Paginator components that work with the Laravel Jetstream/Breeze Inertia/Vue3 stack.

  1. A simple Paginator with just arrows left and right to paginate through Collection provided by e.g. the Inertia render function. SimplePaginator
  2. A "standard" paginator with feedback on the current and total amounts of the results, page numbers and arrows to navigate. Paginator

The components templates are analogous to the 'official' Blade templates provided by the basic paginator included by Laravel

Installation

Via Composer

$ composer require svnwa/inertiavuepaginator

Afterwards publish the Vue Components to use within your application

$ php artisan vendor:publish --tag=inertiavuepaginator

Usage

With Inertia just use the paginate() as you would in a PHP/Blade Laravel context. E.g.:

public function index()
{
    return Inertia::render('MyUserList',[
        'paginator' => User::paginate(10)
    ]);
}

In your Vue component (MyUserList.vue in this example) use the paginator prop provided by the Inertia render function and dynamically bind it to your Paginator component as you would with any other prop.

<template>
    <Paginator :paginator="paginator" />
</template>

<script>
import Paginator from "@/Components/Paginator";
export default {
    props: {
            paginator: Object
        },
}
</script>

OR

<template>
    <SimplePaginator :paginator="paginator" />
</template>

<script>
import SimplePaginator from "@/Components/SimplePaginator";
export default {
    props: {
            paginator: Object
        },
}
</script>

Done. The Rest is handled by the Vue component itself

Credits

License

MIT. Please see the license file for more information.

Related Packages

laravel/breeze

Minimal Laravel authentication scaffolding with Blade and Tailwind.

42,583,127 3,059
ebess/advanced-nova-media-library

Laravel Nova tools for managing the Spatie media library.

3,780,400 616
coroowicaksono/chart-js-integration

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

2,230,656 217
timothyasp/nova-color-field

A Laravel Nova Color Picker field.

1,841,674 76
dillingham/nova-ajax-select

Nova Ajax Select

1,410,728 86

Version History

Version Released Laravel License
1.0 ~7|~8 license