$db['password']]); $process->setTimeout(120); $process->run(); if (!$process->isSuccessful()) { ActivityLog::record('backup', 'Gagal membuat backup database'); return response()->json(['message' => 'Backup gagal: ' . $process->getErrorOutput()], 500); } ActivityLog::record('backup', 'Mengunduh backup database'); $filename = 'backup-webgis-' . now()->format('Ymd-His') . '.sql'; return response($process->getOutput(), 200, [ 'Content-Type' => 'application/sql', 'Content-Disposition' => "attachment; filename=\"{$filename}\"", ]); } }