Skip to content
This repository was archived by the owner on Oct 1, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/Connectors/ConnectionFactory.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace MStaack\LaravelPostgis\Connectors;

use Illuminate\Database\Connection;
use PDO;
use MStaack\LaravelPostgis\PostgisConnection;

Expand All @@ -15,8 +16,8 @@ class ConnectionFactory extends \Bosnadev\Database\Connectors\ConnectionFactory
*/
protected function createConnection($driver, $connection, $database, $prefix = '', array $config = [])
{
if ($this->container->bound($key = "db.connection.{$driver}")) {
return $this->container->make($key, [$connection, $database, $prefix, $config]);
if ($resolver = Connection::getResolver($driver)) {
return $resolver($connection, $database, $prefix, $config);
}

if ($driver === 'pgsql') {
Expand Down
9 changes: 0 additions & 9 deletions src/PostgisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

class PostgisConnection extends PostgresConnection
{
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');
$this->getDoctrineSchemaManager()->getDatabasePlatform()->registerDoctrineTypeMapping('geometry', 'string');
}

/**
* Get the default schema grammar instance.
*
Expand Down