From 52556e9f9cba4f5ef9e9eb86716d6a1763a31ddf Mon Sep 17 00:00:00 2001 From: DevSoftTech Server Date: Wed, 15 Apr 2026 08:19:40 +0530 Subject: [PATCH] Move database credentials to .env for security best practices --- app/Config/Database.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/Config/Database.php b/app/Config/Database.php index 0978dfc..928adf5 100644 --- a/app/Config/Database.php +++ b/app/Config/Database.php @@ -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' => [