diff --git a/src/TermBuilder.php b/src/TermBuilder.php index 8159f34..5ffbeba 100644 --- a/src/TermBuilder.php +++ b/src/TermBuilder.php @@ -8,7 +8,7 @@ public static function terms($search){ // Remove every boolean operator (+, -, > <, ( ), ~, *, ", @distance) from the search query // else we will break the MySQL query. - $search = preg_replace('/[+\-><\(\)~*\"@]+/', ' ', $search); + $search = rtrim(preg_replace('/[+\-><\(\)~*\"@]+/', ' ', $search)); $terms = collect(preg_split('/[\s,]+/', $search));