I use Spatie Laravel package I can take backup by running this command
php artisan backup:run
but I want to take back up form admin panel and running this command form controller, I create a route and controller and in the controller, I do this
public function backup(){
\Artisan::call('backup:run');
return "successfully!";
}
when I route to this finally I got the success message but in the backup file, nothing added.
You can put artisan command in sheduler. It will make back up for example every day at the same time. You do it in
app/console/Kernel.php
Remember to set your server for cron jobs:
Read more: https://laravel.com/docs/5.6/scheduling