protected static function getGlobalSearchEloquentQuery(): Builder
{
$updates = collect(request()?->get('updates') ?: []);
$term = $updates
->filter(function (array $update) {
$type = data_get($update, 'type');
$payload = data_get($update, 'payload.name');
if ($type !== 'syncInput') {
return false;
}
return $payload === 'search';
})
->value('payload.value');
if (! $term) {
return parent::getGlobalSearchEloquentQuery();
}
$term = strtolower($term);
return parent::getGlobalSearchEloquentQuery()->orWhereRaw("LOWER(content) LIKE '%serving%'");
}
protected static function getGlobalSearchEloquentQuery(): Builder
{
$updates = collect(request()?->get('updates') ?: []);
$term = $updates
->filter(function (array $update) {
$type = data_get($update, 'type');
$payload = data_get($update, 'payload.name');
if ($type !== 'syncInput') {
return false;
}
return $payload === 'search';
})
->value('payload.value');
if (! $term) {
return parent::getGlobalSearchEloquentQuery();
}
$term = strtolower($term);
return parent::getGlobalSearchEloquentQuery()->orWhereRaw("LOWER(content) LIKE '%serving%'");
}