Skip to content

Commit 3178080

Browse files
Configure db
1 parent 2df5881 commit 3178080

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

config/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@
209209
'Hash' => Illuminate\Support\Facades\Hash::class,
210210
'Http' => Illuminate\Support\Facades\Http::class,
211211
'Lang' => Illuminate\Support\Facades\Lang::class,
212-
'Log' => Illuminate\Support\Facades\Log::class,
212+
'Log' => 'errorlog',
213213
'Mail' => Illuminate\Support\Facades\Mail::class,
214214
'Notification' => Illuminate\Support\Facades\Notification::class,
215215
'Password' => Illuminate\Support\Facades\Password::class,

config/database.php

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

33
use Illuminate\Support\Str;
4-
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);
59
return [
610

711
/*
@@ -45,17 +49,15 @@
4549

4650
'mysql' => [
4751
'driver' => 'mysql',
48-
'url' => env('DATABASE_URL'),
49-
'host' => env('DB_HOST', '127.0.0.1'),
52+
'host' => $host,
5053
'port' => env('DB_PORT', '3306'),
51-
'database' => env('DB_DATABASE', 'forge'),
52-
'username' => env('DB_USERNAME', 'forge'),
53-
'password' => env('DB_PASSWORD', ''),
54+
'database' => $database,
55+
'username' => $username,
56+
'password' => $password,
5457
'unix_socket' => env('DB_SOCKET', ''),
5558
'charset' => 'utf8mb4',
5659
'collation' => 'utf8mb4_unicode_ci',
5760
'prefix' => '',
58-
'prefix_indexes' => true,
5961
'strict' => true,
6062
'engine' => null,
6163
'options' => extension_loaded('pdo_mysql') ? array_filter([

0 commit comments

Comments
 (0)