vmware_id = $vmware_id; $this->serviceVCenter = $service; $this->data = $data; } /** * Execute the job. * * @return void */ public function handle() { $status = $this->serviceVCenter->CheckVirtualMachine($this->vmware_id); if ($status['error'] === true) { throw new \Exception(json_encode($status['message'])); } if ($status['data']['operations_ready'] === false) { do { sleep(10); $status = $this->serviceVCenter->CheckVirtualMachine($this->vmware_id); } while ($status['data']['operations_ready'] !== true); } $jobs_configNetwork = new GetNetworkVirtualMachine($this->vmware_id,$this->data,$this->serviceVCenter); dispatch($jobs_configNetwork)->delay(now()->addSeconds(5)); } }