Skip to content

Commit

Permalink
Update database.php with new config KVs (#1283)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssi-anik authored Dec 26, 2024
1 parent 4eb662c commit 5dc74c4
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions config/database.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,18 @@

'sqlite' => [
'driver' => 'sqlite',
'url' => env('DB_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => env('DB_PREFIX', ''),
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
'busy_timeout' => null,
'journal_mode' => null,
'synchronous' => null,
],

'mysql' => [
'driver' => 'mysql',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', 3306),
'database' => env('DB_DATABASE', 'forge'),
Expand All @@ -52,9 +58,34 @@
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => env('DB_PREFIX', ''),
'prefix_indexes' => env('DB_PREFIX_INDEXES', true),
'strict' => env('DB_STRICT_MODE', true),
'engine' => env('DB_ENGINE'),
'timezone' => env('DB_TIMEZONE', '+00:00'),
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],

'mariadb' => [
'driver' => 'mariadb',
'url' => env('DB_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'laravel'),
'username' => env('DB_USERNAME', 'root'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => env('DB_CHARSET', 'utf8mb4'),
'collation' => env('DB_COLLATION', 'utf8mb4_unicode_ci'),
'prefix' => env('DB_PREFIX', ''),
'prefix_indexes' => env('DB_PREFIX_INDEXES', true),
'strict' => env('DB_STRICT_MODE', true),
'engine' => env('DB_ENGINE'),
'timezone' => env('DB_TIMEZONE', '+00:00'),
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],

'pgsql' => [
Expand All @@ -66,19 +97,24 @@
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => env('DB_PREFIX', ''),
'prefix_indexes' => env('DB_PREFIX_INDEXES', true),
'search_path' => env('DB_SCHEMA', 'public'),
'sslmode' => env('DB_SSL_MODE', 'prefer'),
],

'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DB_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', 1433),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => env('DB_CHARSET', 'utf8'),
'prefix' => env('DB_PREFIX', ''),
'prefix_indexes' => env('DB_PREFIX_INDEXES', true),
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
],

],
Expand Down

0 comments on commit 5dc74c4

Please sign in to comment.