'Backup failed in Browser, works with php artisan backup:run
I am new to Laravel, I have created a driver with the create function to create backups to my database on xampp server, but my problem is that in the browser it does not show me any errors but no backup of my database is created. Help me please. Here I leave the code of my create function.
public function create()
{
try {
// start the backup process
Artisan::call('backup:run', ['--only-db'=> true,'--disable-notifications'=> true]);
$output = Artisan::output();
// log the results
Log::info("Backpack\BackupManager -- new backup started from admin interface \r\n" . $output);
// return the results as a response to the ajax call
Alert::success('Nuevo Backup Creado');
return redirect()->back();
} catch (Exception $e) {
Flash::error($e->getMessage());
return redirect()->back();
}
}
Solution 1:[1]
Artisan::call('backup:run');
does not work use queue instead of call
working syntax
Artisan::queue('backup:run');
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Mohamed Raza |