Is it possible to make searchable column on relation?
Hi guys, is it possible to search on table on relation?
2 Replies
use something like:
->searchable(query: function (Builder $query, string $search): Builder {
return $query
->whereRelation('relatedModel', 'name', 'like', '%' . $search . '%');
}),
That works just fine. Thank you. π