digit7s / inertia-table
A backend-driven Inertia Datatable for Laravel and Vue 3
Requires
- php: ^8.2
- illuminate/console: ^12.0|^13.0
- illuminate/database: ^12.0|^13.0
- illuminate/support: ^12.0|^13.0
- inertiajs/inertia-laravel: ^2.0|^3.0
Requires (Dev)
- laravel/pint: ^1.29
- orchestra/testbench: ^10.0|^11.0
- pestphp/pest: ^3.0|^4.0
- pestphp/pest-plugin-laravel: ^3.0|^4.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-10 05:37:55 UTC
README
A backend-driven datatable package for Laravel, Inertia.js, and Vue 3.
Define your table structure, query, searching, sorting, filtering, row actions, bulk actions, and grouping in PHP, then render the result with published Vue 3 components in your Laravel/Inertia application.
โจ Features
- ๐ Backend-driven tables: Manage columns, sorting, searching, filtering, actions, and pagination from PHP.
- ๐ Global search: Search across multiple columns, including relationship fields.
- ๐๏ธ Dynamic filters: Supports
text,select, andbooleanfilters. - ๐ Smart sorting: Built-in column-based sorting with direction handling.
- ๐ Pagination: Integrates with Laravel's native paginator.
- ๐จ Modern Vue UI: Published Vue 3 components built for Tailwind CSS and shadcn-vue.
- ๐งฉ Custom cell rendering: Override cell rendering using Vue slots.
- ๐ฆ Bulk actions: Built-in multi-row actions with confirmation support.
- ๐ Grouping: Organize rows into expandable groups by column.
- ๐งฑ Publishable frontend components: Publish and customize the Vue table components inside your own app.
โ Version Support
| Package Version | PHP | Laravel | Inertia Laravel | Vue.js | Tailwind CSS | shadcn-vue | Status |
|---|---|---|---|---|---|---|---|
2.x |
8.2+ (Laravel 12); 8.3+ (Laravel 13) |
12.x, 13.x |
2.x (Laravel 12); 3.x (Laravel 13) |
3.x |
3.x, 4.x |
Declared | Current |
1.x |
^8.2 |
10.xโ13.x (earlier declaration) |
^1.0, ^2.0, ^3.0 (earlier declaration) |
3.x |
3.x, 4.x |
Earlier release line |
This table lists declared Composer support. The release CI matrix exercises representative compatible Laravel, Inertia Laravel, and PHP combinations; a Composer constraint by itself is not proof that a combination has passed tests. Laravel 10 and 11 applications must upgrade Laravel before installing v2.0.0. The earlier v1.x Composer declaration included Laravel 10 and 11, but package installability does not imply those Laravel versions receive upstream security support.
๐ Requirements
Please refer to the Version Support table for PHP, Laravel, Inertia Laravel, and Vue.js compatibility.
This package has two parts:
- A Laravel/PHP backend table builder.
- Publishable Vue 3 frontend components for your Laravel/Inertia app.
Backend Requirements
- PHP
8.2+ - Laravel
12.xwith PHP 8.2+, or Laravel13.xwith PHP 8.3+ - Inertia Laravel
2.xon Laravel 12, or3.xon Laravel 13
Frontend Requirements
The published Vue components expect your Laravel/Inertia app to already have the following frontend stack installed and configured:
- Vue 3
@inertiajs/vue3- Tailwind CSS
- shadcn-vue
lucide-vue-next
Required shadcn-vue Components
The published components import shadcn-vue components from your app's @/components/ui directory.
Make sure these components exist in your consuming Laravel app:
badgebuttoncheckboxdialogdropdown-menuinputselecttable
Depending on the features you use, additional shadcn-vue components may be required in future versions.
Note: shadcn-vue components are generated into your application. They are not normal npm package imports. This package expects those components to exist in the consuming Laravel app after publishing the table components.
๐ Installation
For Laravel 10/11 upgrade guidance and v2 behavior changes, see the v2 migration guide.
Install the package via Composer:
composer require digit7s/inertia-table
Publish Vue Components
Since the table UI is built with Vue 3 and Tailwind CSS, publish the components into your Laravel app:
php artisan vendor:publish --tag="inertia-table-components"
This will publish the components to:
resources/js/components/inertia-table/
After publishing, you may customize the Vue components to match your application's design system.
๐ Basic Usage
1. Generate a Table Class
Use the Artisan command to create a new table class:
php artisan make:inertia-table UsersTable User
This will create:
app/Tables/UsersTable.php
2. Configure the Table
Define your query and columns in the generated table class:
namespace App\Tables; use App\Models\User; use Digit7s\InertiaTable\Column; use Digit7s\InertiaTable\Columns\DateColumn; use Digit7s\InertiaTable\Columns\TextColumn; use Digit7s\InertiaTable\InertiaTable; use Illuminate\Database\Eloquent\Builder; class UsersTable extends InertiaTable { protected ?string $model = User::class; public function query(): Builder { return User::query(); } public function columns(): array { return [ Column::make('id', 'ID')->sortable(), TextColumn::make('name')->searchable()->sortable(), TextColumn::make('email')->searchable(), TextColumn::make('roles.name', 'Role')->searchable(), DateColumn::make('created_at', 'Joined')->sortable(), ]; } }
3. Return the Table from a Controller
use App\Tables\UsersTable; use Inertia\Inertia; public function index() { return Inertia::render('Users/Index', [ 'users' => (new UsersTable())->toInertia(), ]); }
4. Render the Table in Vue
<script setup lang="ts"> import InertiaTable from '@/components/inertia-table/InertiaTable.vue'; defineProps<{ users: Record<string, unknown>; }>(); </script> <template> <InertiaTable :table-data="users" /> </template>
If your component currently expects
tableDatainstead oftable-data, both are the same Vue prop in templates because Vue supports kebab-case usage for camelCase props.
๐ Advanced Features
Column Types
The package provides specialized column types for common table data:
TextColumn: Default text representation.NumericColumn: Right-aligned number/currency display.BadgeColumn: Displays values as badges.BooleanColumn: Displays boolean values with visual indicators.DateColumn/DateTimeColumn: Formats date and datetime values.ImageColumn: Displays image/avatar-style values.TagsColumn: Displays arrays as badge groups.
Example:
use Digit7s\InertiaTable\Columns\TagsColumn; TagsColumn::make('tags') ->labelKey('name') ->badgeClass('bg-blue-500 text-white');
๐ Row Actions & Links
Clickable Rows
Make the entire row clickable:
public function query(): Builder { $this->rowLink(fn (User $user) => route('users.show', $user->id)); return User::query(); }
Row Actions Dropdown
Add row-level actions to your table:
use Digit7s\InertiaTable\Action; use Digit7s\InertiaTable\Columns\ActionColumn; public function columns(): array { return [ TextColumn::make('name'), ActionColumn::new(), ]; } public function actions(): array { return [ Action::make('edit', 'Edit') ->icon('Pencil') ->url(fn (User $user) => route('users.edit', $user->id)), Action::make('delete', 'Delete') ->icon('Trash') ->method('delete') ->requiresConfirmation() ->url(fn (User $user) => route('users.destroy', $user->id)), ]; }
๐ฆ Bulk Actions
Enable multi-row operations with a floating bulk action bar:
use Digit7s\InertiaTable\BulkAction; public function bulkActions(): array { return [ BulkAction::make('delete', 'Delete Selected') ->icon('Trash') ->requiresConfirmation() ->action(function (array $ids) { User::whereIn('id', $ids)->delete(); }), ]; }
CSV Export
CSV export is disabled by default.
Enable it in your table class:
use Digit7s\InertiaTable\Exports\CsvExport; public function exports(): array { return [ CsvExport::make('products.csv') ->label('Export CSV') ->onlyVisibleColumns() ->withCurrentFilters() ->withCurrentSort(), ]; }
The package uses Laravel streamDownload() and PHP fputcsv().
No external export dependency is required.
๐ Grouping
Organize records into expandable groups:
Column::make('status')->groupable();
You may also define a default group:
protected ?string $defaultGroup = 'status';
๐จ Customizing Cells
You can override any cell's rendering using Vue slots.
<template> <InertiaTable :table-data="users"> <template #cell-name="{ item }"> <div class="flex flex-col"> <span class="font-bold">{{ item.name }}</span> <span class="text-xs text-gray-500">{{ item.email }}</span> </div> </template> <template #cell-actions="{ item }"> <Button variant="outline" size="sm" @click="edit(item)"> Edit </Button> </template> </InertiaTable> </template>
Slot names follow this format:
cell-{column-key}
For flat columns, item.name remains available. Dotted relationship column values are available at item._column_values?.['company.name']. The table automatically eager-loads the relationship for resolution but does not add that automatically loaded model to the row payload. Existing item.company?.name slots continue to work only when the application's own query already eager-loads and serializes company; update those slots to use _column_values if they relied on the table's automatic relationship eager loading. This avoids exposing whole related models and unrelated attributes in the Inertia payload.
For example:
| Column Key | Slot Name |
|---|---|
name |
cell-name |
email |
cell-email |
status |
cell-status |
actions |
cell-actions |
๐งฉ Frontend Customization
After publishing the components, you can customize them directly in your app:
resources/js/components/inertia-table/
Common customization points:
- Table layout
- Cell styling
- Empty state
- Pagination UI
- Filter UI
- Row action dropdown
- Bulk action bar
- Confirmation dialog
- Column visibility menu
- Responsive behavior
Because the components are published into your application, you are free to adapt them to your design system.
๐ Documentation
For detailed information on each feature, see the documentation inside the docs/ folder:
- Documentation Index
- Changelog
- Installation
- Usage
- CSV Export
- Accessibility
- Example App
- Troubleshooting
๐งช Testing
If you are contributing to the package, run the test suite:
composer test
If no test script is configured, run Pest directly:
vendor/bin/pest
You may also run Laravel Pint if it is installed:
vendor/bin/pint
๐งญ Roadmap
See the Roadmap for planned and potential future improvements.
๐ค Contributing
Contributions are welcome.
Before submitting a pull request:
- Keep changes focused.
- Follow the existing code style.
- Add or update tests when possible.
- Update documentation when behavior changes.
- Confirm the package still works in a Laravel/Inertia/Vue app.
๐ Security
If you discover a security vulnerability, please report it privately instead of opening a public issue.
๐ License
The MIT License (MIT). Please see License File for more information.