for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Webelightdev\LaravelDbBackup\Commands;
use Illuminate\Console\Command;
use Webelightdev\LaravelDbBackup\BackupStorage\Backup;
class DbBackupCommand extends Command
{
protected $backup;
protected $storage;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'run:dbbackup';
* The console command description.
protected $description = 'Create Database backup.';
* Create a new command instance.
* @return void
@return
Adding a @return annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.
Please refer to the PHP core documentation on constructors.
public function __construct(Backup $backup, Storage $storage)
parent::__construct();
$this->backup = $backup;
$this->storage = $storage;
}
* Execute the console command.
* @return mixed
public function handle()
$backup_file = $this->backup->createBackup();
$this->storage->uploadFile($backup_file);
unlink($backup_file);
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.