snipe-it/app/Console/Commands/SystemBackup.php
snipe 85243423cf Add optional filename to backup
Signed-off-by: snipe <snipe@snipe.net>
2023-05-08 12:20:43 -07:00

48 lines
936 B
PHP

<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
class SystemBackup extends Command
{
/**
* The console command name.
*
* @var string
*/
protected $signature = 'snipeit:backup {--filename=}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command creates a database dump and zips up all of the uploaded files in the upload directories.';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return mixed
*/
public function handle()
{
if ($this->option('filename')) {
$this->call('backup:run', ['--filename' => $this->option('filename')]);
} else {
$this->call('backup:run');
}
}
}