Skip to content

Multiple tables

Give each table a distinct name in the Laravel response:

Laravel

return Inertia::render('dashboard', [
UsersTable::make('active_users')->data($activeUsers),
UsersTable::make('invited_users')->data($invitedUsers),
]);

Reuse one table class or use different classes when the definitions differ.

React

import { AppTable } from '@/components/app-table';
export default function Dashboard() {
return (
<>
<h2>Active users</h2>
<AppTable prop="active_users" />
<h2>Invited users</h2>
<AppTable prop="invited_users" />
</>
);
}

Both use the application provider from Installation. Each table has its own URL parameters and partial reloads. Do not reuse an ID for two instances on the same page.

View Markdown