musing / inertia-table
Server-driven data tables for Laravel and Inertia.js.
Fund package maintenance!
Requires
- php: ^8.3
- illuminate/contracts: ^12.0||^13.0
- inertiajs/inertia-laravel: ^2.0||^3.0
- spatie/laravel-package-tools: ^1.16
- spatie/laravel-query-builder: ^7.0
Requires (Dev)
- kirschbaum-development/eloquent-power-joins: ^4.3
- larastan/larastan: ^3.0
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.8
- orchestra/testbench: ^11.0.0||^10.0.0
- pestphp/pest: ^4.0
- pestphp/pest-plugin-arch: ^4.0
- pestphp/pest-plugin-laravel: ^4.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-deprecation-rules: ^2.0
- phpstan/phpstan-phpunit: ^2.0
Suggests
- kirschbaum-development/eloquent-power-joins: Required for automatic relationship column sorting.
- maatwebsite/excel: Required for optional XLSX and PDF table exports.
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-08 06:48:25 UTC
README
Server-driven data tables for Laravel, Inertia.js, and Vue. Declare columns, search, filters, actions, and exports in PHP, then render the result with one Vue component.
The server remains authoritative: browser input can use only capabilities declared by the table. Each table keeps isolated URL state, and Spatie Laravel Query Builder executes the allowlisted query.
Warning
The package is under active development before v1.0. Minor releases may contain API changes.
Features
| Capability | Included |
|---|---|
| Querying | Server-side search and filters, sorting, relationships, and pagination |
| Layout | Visibility, order, resizing, and sticky columns |
| Workflows | Row and bulk actions, all-matching selection, queues, and progress |
| Reporting | Complete-result summaries and CSV, XLSX, or PDF exports |
| Preferences | Namespaced URL state and scoped Saved Views |
| Rendering | Vue renderer, typed composables, slots, and CSS hooks, plus English and Vietnamese |
Explore the documentation or the playground source.
Requirements
| Layer | Requirement |
|---|---|
| PHP | 8.3+ |
| Laravel | 12 or 13 |
| Inertia | Laravel 2 or 3; Vue 3.4+ |
| Query engine | Spatie Laravel Query Builder 7 |
| Frontend peers | Tailwind CSS 4.1+, Reka UI 2.10+, @lucide/vue 1.30+ |
Installation
composer require musing/inertia-table npm install @musing/inertia-table-vue
Add the package's Vue source to the host application's Tailwind stylesheet:
/* resources/css/app.css */ @source '../../node_modules/@musing/inertia-table-vue/resources/js/**/*.vue';
Import the renderer stylesheet once in the application entry point:
import "@musing/inertia-table-vue/style.css";
Quick start
Generate a table:
php artisan make:inertia-table TopicsTable --model=Topic
Declare the query and its browser-facing capabilities:
<?php namespace App\Tables; use App\Models\Topic; use Illuminate\Database\Eloquent\Builder; use Musing\InertiaTable\Columns\DateTimeColumn; use Musing\InertiaTable\Columns\TextColumn; use Musing\InertiaTable\Filters\SetFilter; use Musing\InertiaTable\Table; final class TopicsTable extends Table { protected ?string $defaultSort = 'name'; public function query(): Builder { return Topic::query(); } public function columns(): array { return [ TextColumn::make('name')->searchable()->sortable(), DateTimeColumn::make('created_at', 'Created')->sortable(), ]; } public function filters(): array { return [ SetFilter::make('status')->options([ 'published' => 'Published', 'draft' => 'Draft', ]), ]; } }
Return the table from an Inertia controller:
use App\Tables\TopicsTable; return inertia('Topics/Index', [ 'topics' => TopicsTable::make(), ]);
Render it in Vue:
<script setup lang="ts"> import { DataTable, type TableResource } from "@musing/inertia-table-vue"; type Topic = { id: number; name: string; status: string; created_at: string; }; defineProps<{ topics: TableResource<Topic> }>(); </script> <template> <DataTable :resource="topics" /> </template>
This provides server-side search, sorting, filtering, pagination, URL state, column controls, and the standard empty-state UI. Continue with the getting started guide.
Documentation
- Search and filters
- Actions and selection
- Queues
- Exports
- Saved Views
- Relationships
- Customization
- PHP API
- Vue API
Packages and project links
Development
See the contributor guide for local setup, test suites, contract fixtures, and documentation commands.
License
Musing Inertia Table is open-source software licensed under the MIT license.
