/** * Get the schema grammar out of a migration connection. * * @param \Illuminate\Database\Connection $connection * @return \Illuminate\Database\Schema\Grammars\Grammar */ protected function getSchemaGrammar($connection) { if (is_null($grammar = $connection->getSchemaGrammar())) { $connection->useDefaultSchemaGrammar(); $grammar = $connection->getSchemaGrammar(); } return $grammar; }