Skip to content

Commit 64bd6e7

Browse files
Copilotlucacri
andcommitted
fix: Laravel 12 Grammar constructor compatibility
Pass connection instance to QueryGrammar and SchemaGrammar constructors to support Laravel 12 requirement while maintaining backward compatibility with Laravel 11. Co-authored-by: lucacri <[email protected]>
1 parent 12d399d commit 64bd6e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/CockroachDbConnection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CockroachDbConnection extends PostgresConnection implements ConnectionInte
2222
*/
2323
protected function getDefaultQueryGrammar(): BaseGrammar
2424
{
25-
return $this->withTablePrefix($this->setConnection(new QueryGrammar()));
25+
return $this->withTablePrefix($this->setConnection(new QueryGrammar($this)));
2626
}
2727

2828
/**
@@ -46,7 +46,7 @@ public function getSchemaBuilder(): DbBuilder
4646
*/
4747
protected function getDefaultSchemaGrammar(): BaseGrammar
4848
{
49-
return $this->withTablePrefix($this->setConnection(new SchemaGrammar()));
49+
return $this->withTablePrefix($this->setConnection(new SchemaGrammar($this)));
5050
}
5151

5252
/**

0 commit comments

Comments
 (0)