Skip to content

Searching

Mark any text column ->searchable() and Lattice renders a search box above the table. Typing filters rows server-side, matching the term against every searchable column at once. The box appears only when a table has at least one searchable column.

TextColumn::make('name')->label('Name')->sortable()->searchable();
TextColumn::make('email')->label('Email')->link('mailto:{value}')->searchable();
TextColumn::make('team')->label('Team');

->searchable() opts a column into the global search. It is independent of ->filterable() — a column can be searchable, filterable, both, or neither:

use Lattice\Table\Columns\TextColumn;
TextColumn::make('name')->searchable();
TextColumn::make('email')->searchable()->filterable(); // both
TextColumn::make('internal_note'); // neither

Relation columns are searchable too — a dotted to-one key or a ->multiple() to-many list matches through whereHas, the same machinery filtering uses:

TextColumn::make('businessPartner.name')->searchable(); // to-one relation
TextColumn::make('tags')->multiple('name')->searchable(); // to-many relation

The term is a single, case-insensitive contains match, OR-grouped across the searchable columns and combined with any active filters using AND — so a search narrows within the current filter set rather than replacing it. LIKE wildcards in the term are escaped.

The box debounces input and resets to the first page on each change. The term rides the table endpoint as ?q=…, so it is part of the shareable table state and is respected by bulk “select all matching” actions.