Skip to content

Generating Tables

You may create a new Table class via the make:inertia-table Artisan command. It scaffolds the class inside the App\Tables namespace and infers the Eloquent model name from the table name.

bash
php artisan make:inertia-table Users

The generated Table class looks like this:

php
<?php

namespace App\Tables;

use App\Models\User;
use InertiaUI\Table\Action;
use InertiaUI\Table\Columns;
use InertiaUI\Table\Filters;
use InertiaUI\Table\Table;

class Users extends Table
{
    protected ?string $resource = User::class;

    public function columns(): array
    {
        return [
            //
        ];
    }

    public function filters(): array
    {
        return [
            //
        ];
    }

    public function actions(): array
    {
        return [
            //
        ];
    }

    public function exports(): array
    {
        return [
            //
        ];
    }
}