Skip to content

Commit 8eb2a0b

Browse files
Laravel 12.x Compatibility (#88)
Co-authored-by: Pascal Baljet <pascal@protone.media>
1 parent b07726d commit 8eb2a0b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

.github/workflows/run-tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ jobs:
1212
fail-fast: true
1313
matrix:
1414
php: [8.4, 8.3, 8.2]
15-
laravel: ["10.*", "11.*"]
15+
laravel: ["10.*", "11.*", "12.*"]
1616
dependency-version: [prefer-lowest, prefer-stable]
1717
include:
1818
- laravel: 10.*
19-
testbench: 8.*
19+
testbench: ^8.32
2020
- laravel: 11.*
21-
testbench: 9.*
21+
testbench: ^9.10
22+
- laravel: 12.*
23+
testbench: ^10.0
2224

2325
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}
2426

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
],
1818
"require": {
1919
"php": "^8.2|^8.3|^8.4",
20-
"illuminate/support": "^10.0|^11.0"
20+
"illuminate/support": "^10.48.28|^11.43|^12.0"
2121
},
2222
"require-dev": {
2323
"mockery/mockery": "^1.4.4",
24-
"orchestra/testbench": "^8.0|^9.0",
25-
"phpunit/phpunit": "^10.4"
24+
"orchestra/testbench": "^8.0|^9.0|^10.0",
25+
"phpunit/phpunit": "^10.4|^11.5.3"
2626
},
2727
"autoload": {
2828
"psr-4": {

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)