Skip to content

Search

Call searchable() on the text columns you want the search box to match:

Laravel

use InertiaX\Table\Columns\TextColumn;
TextColumn::make('name')->searchable();
TextColumn::make('email')->searchable();

The search box appears when at least one column is searchable. Built-in Eloquent and collection search matches rows when any searchable column contains the term, ignoring case. Applied filters also constrain the results.

Laravel

use App\Models\User;
use InertiaX\Table\Table;
Table::make('users')
->data(User::class)
->autoColumns()
->searchableColumns();

Text columns inherit the search default. For Eloquent and collections, columns with a searchUsing() callback also inherit it; other types stay non-searchable. Set searchable(false) on an individual column to exclude it. See Column-wide defaults for precedence and validation.

Search resets the table to page 1. Requests wait 300 ms after the latest search or filter change. Set the delay on the React component:

React

<AppTable prop="users" debounceMs={250} />

Use 0 for immediate requests. See Request lifecycle for cancellation and URL state.

To search a related record’s field, such as an order’s customer name, make a relationship() column searchable; see Show a related field.

For Eloquent and collections, searchable columns with a type other than text, including custom types, need a searchUsing() callback. See Custom query behavior for source declarations and callback examples, and Table API for search limits.

A custom source handles search itself and requires searchable columns to keep type('text'). See Custom-source search.

View Markdown