data = $data; $this->info = $info; $this->telegram = new Telegram(); // } /** * Execute the job. * * @return void */ public function handle() { $this->data->update([ 'name' => $this->data->ipaddress->ip . '_' . $this->data->cannotustomer->firstname, 'port' => $this->info['port'], 'user' => $this->info['user'], 'password' => SignRSA::EncryptFunc($this->info['password']), 'status' => 1 ]); $this->data->ipAddress->update([ 'vm_name' => $this->data->IpAddress->ip . '_' . $this->data->Customer->firstname, 'status' => 1 ]); $setting = Setting::where('key', 'setting')->first(); $data = [ 'company_name' => json_decode($setting->value)->company, 'company_logo' => json_decode($setting->value)->logo, 'client_name' => $this->data->Customer->firstname . " " . $this->data->Customer->lastname, 'product_name' => $this->data->GetInvoiceItem()->GetItemProduct()->name, 'product_billing' => Helper::billing_cycle($this->data->GetInvoiceItem()->billing), 'product_price' => number_format($this->data->GetInvoiceItem()->amount, 0, ',', '.'), 'service_host' => $this->data->IpAddress->ip, 'service_username' => $this->info['user'], 'service_port' => $this->info['port'], 'service_password' => $this->info['password'], 'os_name' => $this->data->Os->OsGroup->name . " " . $this->data->Os->version, 'service_due_exp' => Carbon::parse($this->data->next_due_date)->format('d/m/Y') ]; $mail = new SendInformationVirtualMachine($data, $this->data->Customer); dispatch($mail)->delay(now()->addSeconds(5)); Event(new Create_VirtualMachine_Success("Máy chủ của bạn đã được khởi tạo thành công!", $this->data->customer->id)); $this->telegram->SendInformation($this->data, $this->info['user'], $this->info['password'], $this->info['port']); } }