Services\Synchronize::saveBackupToDB PHP Method

saveBackupToDB() public method

Save the information of the created backup to database
public saveBackupToDB ( $description = '' ) : Object
return Object
    public function saveBackupToDB($description = '')
    {
        $backup = Backup::create(['file' => $this->listener->backup_file, 'includes' => $this->includes, 'description' => $description]);
        return $backup;
    }

Usage Example

Ejemplo n.º 1
0
 public function postBackup()
 {
     $this->current_time = date("Y-m-d-H-i-s");
     $this->backup_dir = backup_path() . "/backup/";
     $this->backup_file = backup_path() . "/backup_{$this->current_time}.zip";
     $this->restore_file = restore_path() . "/backup_{$this->current_time}.zip";
     $synchronizer = new Synchronize($this);
     $synchronizer->startBackup();
     $backup_description = 'Manual backup created';
     $synchronizer->saveBackupToDB($backup_description);
     return Response::download($this->backup_file, "backup_{$this->current_time}.zip");
 }