fix: fix sql export (#1832)
This commit is contained in:
@@ -216,7 +216,7 @@ class SettingsController extends Controller
|
||||
$path = $this->dispatchNow(new ExportAccountAsSQL());
|
||||
|
||||
return response()
|
||||
->download(Storage::disk('public')->getDriver()->getAdapter()->getPathPrefix().$path, 'monica.sql')
|
||||
->download(Storage::disk(ExportAccountAsSQL::STORAGE)->getDriver()->getAdapter()->getPathPrefix().$path, 'monica.sql')
|
||||
->deleteFileAfterSend(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,6 +54,12 @@ class ExportAccountAsSQL
|
||||
protected $file = '';
|
||||
protected $path = '';
|
||||
|
||||
/**
|
||||
* Storage disk used to store the exported file.
|
||||
* @var string
|
||||
*/
|
||||
public const STORAGE = 'public';
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
@@ -153,7 +159,7 @@ class ExportAccountAsSQL
|
||||
$sql .= $newSQLLine;
|
||||
}
|
||||
|
||||
Storage::disk(config('filesystems.default'))->put($downloadPath, $sql);
|
||||
Storage::disk(self::STORAGE)->put($downloadPath, $sql);
|
||||
|
||||
return $downloadPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user