Skip to content

Commit

Permalink
Update MySqlConnection.php (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuell1 authored May 13, 2024
1 parent 0142280 commit aca5202
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 aca5202

Please sign in to comment.