Skip to content

Commit

Permalink
Expanded compatibility of the post keyword filter with additional dat…
Browse files Browse the repository at this point in the history
…abase versions.
  • Loading branch information
lao9s committed Jun 6, 2024
1 parent 2433c86 commit 91f649d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Builders/Filters/PostKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PostKeyword implements Filter
public static function apply(Builder $builder, $value): Builder
{
return $builder->whereHas('versions', function ($query) use ($value) {
$query->whereRaw('LOWER(content->>"$[*].body") LIKE "%' . Str::lower($value) . '%"');
$query->whereRaw('LOWER(JSON_EXTRACT(content, "$[*].body")) LIKE ?', ['%' . Str::lower($value) . '%']);
});
}
}

0 comments on commit 91f649d

Please sign in to comment.