Inertia Table API Reference
This document provides a condensed API specification for implementing Inertia Tables in our Laravel/Inertia.js application.Official Documentation: Inertia Table Introduction
Custom Extensions: Core Table Extensions - Custom traits, columns, and domain object integration
Quick Start
1. Generate Table Class
Official Documentation: Generating Tables
2. Backend Table Implementation
3. Controller Usage
4. Frontend Implementation
Official Documentation: Basic UsageImportant: We use a custom TypeScript component, not the standard Inertia Table component.
Column Types & Options
Official Documentation: ColumnsAll columns support these common options:
| Option | Type | Default | Description |
|---|---|---|---|
sortable | boolean | false | Enable sorting |
searchable | boolean | false | Include in search |
toggleable | boolean | true | Allow hiding/showing |
visible | boolean | true | Initial visibility |
alignment | ColumnAlignment | Left | Text alignment |
wrap | boolean | false | Allow text wrapping |
truncate | int|null | null | Truncate after N lines |
TextColumn
NumericColumn
DateColumn
DateTimeColumn
BooleanColumn
ImageColumn
Official Documentation: Images
BadgeColumn
ActionColumn
InlineEditColumn
Enables inline editing with CoreAction integration:See: Core Action - Inline Edit Integration
Advanced Features
Icon Resolver
Inertia Table uses an icon resolver system to render icons throughout the table (actions, boolean columns, badges, etc.). We always use Lucide icons.Global Icon Resolver
Set up a global icon resolver once in your application:Per-Table Icon Resolver
Override the global resolver for specific tables:Icon Usage in Backend
Icons are referenced by string names in your table classes:DTO Transformation
Official Documentation: Transform Model DataTransform models to DTOs for frontend consumption:
Cell Overrides
Official Documentation: SlotsOverride column rendering in the frontend:
Row Links
Official Documentation: Row LinksMake entire rows clickable to navigate to detail pages:
Sticky Columns
Official Documentation: Sticky Columns and HeaderMake columns stick to the left side when scrolling horizontally:
Empty State
Official Documentation: Empty StateCustomize the message and actions when no data is found:
Common Filters
Official Documentation: Filtering
TextFilter
SetFilter
BooleanFilter
DateFilter
RangeFilter
For numeric ranges like prices or quantities:Actions
Row Actions
Official Documentation: Row Actions
Bulk Actions
Official Documentation: Bulk Actions
Exports
Official Documentation: ExportingConfigure table data exports to CSV/Excel.
Pagination
Official Documentation: PaginationInertia Table supports Laravel’s pagination out of the box and handles rendering. We’ve set a global default to 30, but you can override the count and also choose to provide multiple options if relevant.
Basic Pagination
Multiple Tables
Official Documentation: Multiple TablesYou can have multiple independent tables on the same page. It’s critical to name tables when you have more than one on a page to prevent query string conflicts.
Why Name Tables?
The state of each table (filtering, sorting, pagination) is passed to the Laravel backend via the query string. Without naming, multiple tables would share the same query parameters, causing conflicts. For example:Automatic Table Naming
CoreTable automatically names tables based on the class name, so you don’t need to manually call as():
TransactionTable→ automatically namedtransactionAccountTransactionRequestTable→ automatically namedaccount-transaction-requestUserTable→ automatically nameduser
- Removes the
Tablesuffix from the class name - Converts to kebab-case
Backend Setup
No manual naming needed - tables are automatically named:Manual Override
If you need to override the automatic name, you can still useas():
Frontend Implementation
No changes needed on the frontend - the Table component automatically uses the table name to generate the query string:Key Points
CoreTableautomatically names tables based on class name (e.g.,TransactionTable→transaction)- No manual naming needed - tables are automatically named to prevent conflicts
- You can still override with
as()if you need a custom name - Each table maintains its own independent state (pagination, sorting, filtering)
- The frontend automatically handles the query string namespacing - no changes needed
Key Differences from Standard Inertia Table
- Custom Frontend Component: Import
InertiaTablefrom@/core/components/inertia-table - Table Naming: Use
Tablesuffix (e.g.,UserTable,ProductTable) - Extended Base Class: Use
CoreTableinstead ofTablefor stats and row styling - Custom Columns:
DetailedLinkColumn,ObjectColumn,InlineEditColumnavailable - Scout Integration: Optional
SearchUsingScouttrait available - DTO Support: Use
transformModel()method to convert models to DTOs - TypeScript Props:
InertiaTableResourcetype for table resources
See Core Table Extensions for detailed documentation on custom features.