Skip to main content

Kovah/LinkAce

3173 stars
1 code files
View Kovah/LinkAce on GitHub

app/Http/Controllers/Traits/SearchesLinks.php

Open in GitHub
trait SearchesLinks
{
protected function buildDatabaseQuery(SearchRequest $request): Builder
{
//
if ($this->emptyLists = $request->input('empty_lists', false)) {
$search->doesntHave('lists');
} elseif ($this->searchLists = $request->input('only_lists', false)) {
$search->whereHas('lists', function ($query) use ($request) {
$field = $request->isJson() ? 'id' : 'name';
$query->whereIn($field, explode(',', $this->searchLists));
});
}
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.