vmware_id = $vmware_id; $this->serviceVCenter = $service; $this->data = $data; } /** * Execute the job. * * @return void */ public function handle() { $NetworkForVirtualMachine = $this->serviceVCenter->GetNetworkVirtualMachine($this->vmware_id); if ($NetworkForVirtualMachine['error']) { throw new \Exception(json_encode($NetworkForVirtualMachine['message'])); } $Network = $this->data->IpAddress->Network->network; if ($Network !== $NetworkForVirtualMachine['data']['network']) { $ConfigNetwork = [ "spec" => [ "backing" => [ "type" => $this->data->IpAddress->Network->type, "network" => $this->data->IpAddress->Network->network ] ] ]; $this->serviceVCenter->ConfigNetworkVirtualMachine($this->vmware_id,$ConfigNetwork); } $jobs_configCLI = new ConfigCLICommand($this->vmware_id,$this->data,$this->serviceVCenter); dispatch($jobs_configCLI)->delay(now()->addSeconds(5)); } }