How to access the $search variable in recordSelectOptionsQuery() on RelationManager

I'd like to search another column ('meaning') as well when attaching a record, but how do I access the search variable? This is not working:
Tables\Actions\AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query, $search) => $query->orWhere('meaning', 'like', "%{$search}%"))
->recordTitle(fn (Model $record) => "{$record->text}\n- {$record->meaning}"),
Tables\Actions\AttachAction::make()
->recordSelectOptionsQuery(fn (Builder $query, $search) => $query->orWhere('meaning', 'like', "%{$search}%"))
->recordTitle(fn (Model $record) => "{$record->text}\n- {$record->meaning}"),
2 Replies
GavTheDev
GavTheDevOP2y ago
Ok, so you can set $recordSelectSearchColumns = ['title','meaning]. However, this searches AND (value in both title AND meaning) but this needs to be OR (value in title OR meaning). Is there a way to get that?
Dan Harrin
Dan Harrin2y ago
sounds like a change we should make in the core instead
Want results from more Discord servers?
Add your server