Searchable by pivot name
In a relationmanager I have records with column
name
and a pivot column name
. How do i make the table searchable by the pivot column? I already tried
Tables\Columns\TextColumn::make('name')->searchable()
(column works, search doesn't),
Tables\Columns\TextColumn::make('pivot.name')->searchable()
(column works, search doesn't) and
Tables\Columns\TextColumn::make('pivot_table_name.name')->searchable()
(neither works).1 Reply
Solution
Had to define
searchable(['pivot_table_name.name'])
instead