Skip to content

Commit

Permalink
Update MySqlConnection.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuell1 authored and daftspunk committed May 13, 2024
1 parent 52e67e1 commit 2cc360d
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Database/Connections/MySqlConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ public function isMaria()
*/
protected function getDefaultQueryGrammar()
{
return $this->withTablePrefix(new QueryGrammar);
$grammar = new QueryGrammar;
if (method_exists($grammar, 'setConnection')) {
$grammar->setConnection($this);
}

return $this->withTablePrefix($grammar);
}

/**
Expand All @@ -55,7 +60,12 @@ public function getSchemaBuilder()
*/
protected function getDefaultSchemaGrammar()
{
return $this->withTablePrefix(new SchemaGrammar);
$grammar = new SchemaGrammar;
if (method_exists($grammar, 'setConnection')) {
$grammar->setConnection($this);
}

return $this->withTablePrefix($grammar);
}

/**
Expand Down

0 comments on commit 2cc360d

Please sign in to comment.