Skip to content

Commit 477532a

Browse files
authored
Merge pull request #12 from jayjfletcher/main
- '/' value escaped - Hybrid Relations eloquent bug fix Thank you @jayjfletcher
2 parents 029cebf + 51470a2 commit 477532a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/DSL/QueryBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ private static function _parseParams($key, $value): string
290290

291291
public static function _escape($value): string
292292
{
293-
$specialChars = ['"', '\\', '~', '^'];
293+
$specialChars = ['"', '\\', '~', '^', '/'];
294294
foreach ($specialChars as $char) {
295295
$value = str_replace($char, "\\".$char, $value);
296296
}

src/Eloquent/HybridRelations.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use PDPhilip\Elasticsearch\Relations\MorphTo;
1515
use PDPhilip\Elasticsearch\Relations\MorphOne;
1616
use PDPhilip\Elasticsearch\Eloquent\Model as ParentModel;
17-
17+
use Illuminate\Database\Eloquent\Builder as EloquentBuilder;
1818

1919
trait HybridRelations
2020
{
@@ -185,6 +185,6 @@ public function newEloquentBuilder($query)
185185
return new Builder($query);
186186
}
187187

188-
return new Builder($query);
188+
return new EloquentBuilder($query);
189189
}
190190
}

0 commit comments

Comments
 (0)