fix: resolve sqlite database path for backup download

This commit is contained in:
SajjadMahmoody 2026-05-20 16:11:48 +03:30
parent ad00736707
commit ff61364ec4
1 changed files with 4 additions and 1 deletions

View File

@ -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.');
}