checkExtensionOrThrowError(); //update domain if($params['customfields']['maildomain']){ $params['domain'] = $params['customfields']['maildomain']; $this->hosting()->domain = $params['domain']; $this->hosting()->save(); } /** * run kerio service */ $result = $this->kerioRunService($params); return $result; }catch (\Exception $ex) { /** * return some crit error */ return $ex->getMessage(); } } /** * @param null $params * @return mixed|string */ protected function kerioRunService($params = null) { $api = new KerioConnectApi('whmcsKerioEmail', 'Thurdata', '1.0'); logModuleCall( 'kerioEmail', __FUNCTION__, $api, 'Debug Features & Attributes', $params ); try { $api->login($params['serverhostname'], $params['serverusername'], $params['serverpassword']); $result = $api->sendRequest('Domains.get'); $api->logout(); } catch (KerioApiException $error) { return ['error' => $error->getMessage()]; } /** * return success response */ return Response::SUCCESS; } }