api) { return $this->api; } $host = $this->getServer()->ipaddress ? $this->getServer()->ipaddress : $this->getServer()->hostname; if(is_numeric($this->getServer()->port)){ $host .=":".$this->getServer()->port; } $password = html_entity_decode(decrypt($this->getServer()->password),ENT_QUOTES); return $this->api = new proxmox\Api($host, $this->getServer()->username, $this->getServer()->accesshash,$password ); } /** * * @return main\Core\Models\Whmcs\Server */ public function getServer() { if ($this->server) { return $this->server; } return $this->server = main\Core\Models\Whmcs\Server::findOrFail($this->getServerId()); } public function getServerId() { return $this->serverId; } public function setServerId($serverId) { $this->serverId = $serverId; return $this; } }