fix filtering with operator not like issue

parent f3f230a9
......@@ -978,9 +978,13 @@ class Builder extends BaseBuilder
{
extract($where);
// Replace like with a Regex instance.
if ($operator == 'like') {
$operator = '=';
// Replace like or not like with a Regex instance.
if (in_array($operator, ['like', 'not like'])) {
if (Str::startsWith($operator, 'not')) {
$operator = 'not';
} else {
$operator = '=';
}
// Convert to regular expression.
$regex = preg_replace('#(^|[^\\\])%#', '$1.*', preg_quote($value));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment