From ff61364ec450b931b9a87b316d6eaf62d0189048 Mon Sep 17 00:00:00 2001 From: SajjadMahmoody <117562560+SajjadMahmoody@users.noreply.github.com> Date: Wed, 20 May 2026 16:11:48 +0330 Subject: [PATCH] fix: resolve sqlite database path for backup download --- routes/web.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/routes/web.php b/routes/web.php index 4d899ef..859f102 100644 --- a/routes/web.php +++ b/routes/web.php @@ -43,7 +43,10 @@ set_time_limit(0); ini_set('memory_limit', '256M'); - $dbPath = database_path('database.sqlite'); + $dbRaw = config('database.connections.sqlite.database', 'database/database.sqlite'); + $dbPath = str_starts_with($dbRaw, '/') || preg_match('/^[A-Za-z]:/', $dbRaw) + ? $dbRaw + : base_path($dbRaw); if (! file_exists($dbPath)) { abort(404, 'Database not found.'); }