public static function createForMonitorConfig(array $monitorConfiguration) : Collection
 {
     return collect($monitorConfiguration)->flatMap(function (array $monitorProperties) {
         return BackupDestinationStatusFactory::createForSingleMonitor($monitorProperties);
     })->sortBy(function (BackupDestinationStatus $backupDestinationStatus) {
         return "{$backupDestinationStatus->backupName()}-{$backupDestinationStatus->diskName()}";
     });
 }
Ejemplo n.º 2
0
 public function handle()
 {
     $statuses = BackupDestinationStatusFactory::createForMonitorConfig(config('laravel-backup.monitorBackups'));
     $statuses->each(function (BackupDestinationStatus $backupDestinationStatus) {
         if ($backupDestinationStatus->isHealthy()) {
             $this->info("The backups on {$backupDestinationStatus->diskName()} are considered healthy.");
             event(new HealthyBackupWasFound($backupDestinationStatus));
             return;
         }
         $this->error("The backups on {$backupDestinationStatus->diskName()} are considered unhealthy!");
         event(new UnHealthyBackupWasFound($backupDestinationStatus));
     });
 }
Ejemplo n.º 3
0
 public function handle()
 {
     $statuses = BackupDestinationStatusFactory::createForMonitorConfig(config('laravel-backup.monitorBackups'));
     $this->displayOverview($statuses);
     $this->displayConnectionErrors($statuses);
 }