Move database credentials to .env for security best practices

This commit is contained in:
DevSoftTech Server 2026-04-15 08:19:40 +05:30
parent a0cfbfb5e0
commit 52556e9f9c

View File

@ -26,14 +26,14 @@ class Database extends Config
*/
public array $default = [
'DSN' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'hms_ci4_2026',
'DBDriver' => 'MySQLi',
'hostname' => env('database.default.hostname', 'localhost'),
'username' => env('database.default.username', 'root'),
'password' => env('database.default.password', ''),
'database' => env('database.default.database', 'hms_ci4_2026'),
'DBDriver' => env('database.default.DBDriver', 'MySQLi'),
'DBPrefix' => '',
'pConnect' => false,
'DBDebug' => true,
'DBDebug' => env('database.default.DBDebug', true),
'charset' => 'utf8mb4',
'DBCollat' => 'utf8mb4_general_ci',
'swapPre' => '',
@ -41,7 +41,7 @@ class Database extends Config
'compress' => false,
'strictOn' => false,
'failover' => [],
'port' => 3306,
'port' => env('database.default.port', 3306),
'numberNative' => false,
'foundRows' => false,
'dateFormat' => [