for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php namespace LaravelSpatial;
use LaravelSpatial\Schema\Grammars\PostgresGrammar;
use LaravelSpatial\Schema\PostgresBuilder;
/**
* Class PostgresConnection
*
* @package LaravelSpatial
*/
class PostgresConnection extends \Illuminate\Database\PostgresConnection
{
* @inheritDoc
* @throws \Doctrine\DBAL\Exception
public function __construct($pdo, $database = '', $tablePrefix = '', array $config = [])
parent::__construct($pdo, $database, $tablePrefix, $config);
// Prevent geography type fields from throwing a 'type not found' error.
$this->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('geography', 'string');
}
public function getSchemaBuilder()
if ($this->schemaGrammar === null) {
$this->useDefaultSchemaGrammar();
return new PostgresBuilder($this);
protected function getDefaultSchemaGrammar()
return $this->withTablePrefix(new PostgresGrammar());