Skip to content

Commit 05b5bea

Browse files
committed
Update Searcher.php
1 parent afab6fd commit 05b5bea

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/Searcher.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ private function addNestedRelationToQuery(Builder $query, string $nestedRelation
483483
*/
484484
private function addWhereTermsToQuery(Builder $query, $column)
485485
{
486-
$column = $this->ignoreCase ? (new MySqlGrammar)->wrap($column) : $column;
486+
$column = $this->ignoreCase ? (new MySqlGrammar($query->getConnection()))->wrap($column) : $column;
487487

488488
$this->terms->each(function ($term) use ($query, $column) {
489489
$this->ignoreCase
@@ -510,8 +510,9 @@ private function addRelevanceQueryToBuilder($builder, $modelToSearchThrough)
510510
}
511511

512512
$expressionsAndBindings = $modelToSearchThrough->getQualifiedColumns()->flatMap(function ($field) use ($modelToSearchThrough) {
513-
$prefix = $modelToSearchThrough->getModel()->getConnection()->getTablePrefix();
514-
$field = (new MySqlGrammar)->wrap($prefix . $field);
513+
$connection = $modelToSearchThrough->getModel()->getConnection();
514+
$prefix = $connection->getTablePrefix();
515+
$field = (new MySqlGrammar($connection))->wrap($prefix . $field);
515516

516517
return $this->termsWithoutWildcards->map(function ($term) use ($field) {
517518
return [

0 commit comments

Comments
 (0)