Skip to content

Commit 5cdd1fc

Browse files
Configure db
1 parent 3178080 commit 5cdd1fc

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

config/database.php

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
<?php
22

33
use Illuminate\Support\Str;
4-
$url = parse_url(getenv("CLEARDB_DATABASE_URL"));
5-
$host = $url["host"] ?? null;
6-
$username = $url["user"] ?? null;
7-
$password = $url["pass"] ?? null;
8-
$database = substr($url["path"], 1);
4+
$DATABASE_URL = parse_url('postgres://vlyuadsempcwjp:b92a24dca1ccdcb636ca5af1cd1066149dc2897f3f19021e09bd9dacac3c59c5@ec2-52-6-143-153.compute-1.amazonaws.com:5432/db28nnuf6lhasa');
95
return [
106

117
/*
@@ -19,7 +15,7 @@
1915
|
2016
*/
2117

22-
'default' => env('DB_CONNECTION', 'mysql'),
18+
'default' => env('DB_CONNECTION', 'pgsql'),
2319

2420
/*
2521
|--------------------------------------------------------------------------
@@ -67,17 +63,16 @@
6763

6864
'pgsql' => [
6965
'driver' => 'pgsql',
70-
'url' => env('DATABASE_URL'),
71-
'host' => env('DB_HOST', '127.0.0.1'),
72-
'port' => env('DB_PORT', '5432'),
73-
'database' => env('DB_DATABASE', 'forge'),
74-
'username' => env('DB_USERNAME', 'forge'),
75-
'password' => env('DB_PASSWORD', ''),
66+
'host' => $DATABASE_URL["host"],
67+
'port' => $DATABASE_URL["port"],
68+
'database' => ltrim($DATABASE_URL["path"], "/"),
69+
'username' => $DATABASE_URL["user"],
70+
'password' => $DATABASE_URL["pass"],
7671
'charset' => 'utf8',
7772
'prefix' => '',
78-
'prefix_indexes' => true,
7973
'schema' => 'public',
80-
'sslmode' => 'prefer',
74+
'sslmode' => 'require',
75+
'prefix_indexes' => true,
8176
],
8277

8378
'sqlsrv' => [

0 commit comments

Comments
 (0)