Skip to content

Search

The search field of the toolbar covers the columns marked searchable(). Without searchable columns there is no search field.

TextColumn::make('number')->searchable(),
TextColumn::make('customer_name')->queryColumn('c.name')->searchable(),

Words separated by spaces are joined with OR, a phrase in double quotes stays together. * is a wildcard: a word with * must match the whole value, a word without one is found anywhere.

Search Finds records where a searchable column …
meier contains “meier”
Karl Heinz contains “Karl” or “Heinz”
"Karl Heinz" contains “Karl Heinz”
mei* starts with “mei”
*gmbh ends with “gmbh”
m*r starts with “m” and ends with “r”
mei* *gmbh starts with “mei” or ends with “gmbh”
  • A record matches when any searchable column matches any word.
  • At most ten words are used (duplicates count once); at most 100 characters.
  • % and _ are matched literally; only * is a wildcard. A word of only * is ignored.
  • Case is ignored with the usual case-insensitive collations (MySQL utf8mb4_*_ci).
  • The search is combined with the filters (AND). Typing updates the list 0.4 seconds after the last key; changing the search starts on page 1.
Column Searched in
TextColumn::make('city')->searchable() table.city
with queryColumn('c.name') c.name (e.g. a join)
with queryColumn('p.last_name', 'p.first_name') each of the columns on its own
computed (state()) without queryColumn() not searched

The stored value is searched, not the formatted text: a labels() column finds the code (“open”), not the label (“Open”); a relationship() column cannot be searched by title – join the title and use queryColumn(), see Columns of a join.

For a field of its own, or a composed value such as a full name, use a TextFilter. It uses the same wildcard rules for its whole text (no splitting into words).

The API takes the same syntax as search=, see Resource endpoints.