Skip to content

Commit 23bdbd0

Browse files
committed
Tweak postgres connector.
1 parent f948801 commit 23bdbd0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

laravel/database/connectors/postgres.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public function connect($config)
2424
{
2525
extract($config);
2626

27-
$dsn = "pgsql:host={$host};dbname={$database}";
27+
$host_dsn = isset($host) ? 'host='.$host.';' : '';
28+
29+
$dsn = "pgsql:{$host_dsn}dbname={$database}";
2830

2931
// The developer has the freedom of specifying a port for the PostgresSQL
3032
// database or the default port (5432) will be used by PDO to create the

0 commit comments

Comments
 (0)