modifyQueryUsing option you are still left with the LIKE statement in query. Trying to use getSearchResultsUsing and relationship seems to just throw an errorforeach() argument must be of type array|object, null given when trying to do a search. The relationship authors is BelongsToMany Select::make('authors')
->native(false)
->searchable()
->getSearchResultsUsing(
fn (string $search): array => Author::query()
->whereFullText(['name'], $search, ['mode' => 'boolean'])
->orderByDesc('views')
->get()
->pluck('name', 'id')
)
->multiple()
->relationship(
name: 'authors'
)
//Just for the sake of example, this is/would be dynamic
->getOptionLabelsUsing(fn (array $values): array => [1 => 'Author #1', 2 => 'Author #2'])
->searchDebounce(300)Select::make('authors')
->native(false)
->searchable()
->multiple()
->relationship(
name: 'authors',
titleAttribute: 'name',
modifyQueryUsing: fn (Builder $query, ?string $search) => $query
->when($search, fn ($q) => $q->whereFullText(['name'], $search, ['mode' => 'boolean']))
->orderByDesc('views')
)
->searchDebounce(300)Select::make('authors')
->native(false)
->searchable([])
->multiple()
->relationship(
name: 'authors',
titleAttribute: 'name',
modifyQueryUsing: fn (Builder $query, ?string $search) => $query
->when($search, fn ($q) => $q->whereFullText(['name'], $search, ['mode' => 'boolean']))
->orderByDesc('views')
)
->searchDebounce(300)