config->username != '' || $this->config->password != '') { $this->attrs = ['auth'=> [$this->config->username, $this->config->password]]; } } public function test() { $this->setClientOptions(); $test = parent::appTest($this->url(self::ENDPOINT), $this->attrs); echo $test->status; } public function livestats() { $this->setClientOptions(); $res = parent::execute($this->url(self::ENDPOINT), $this->attrs); $details = json_decode($res->getBody()); $data['count_unread'] = $details->total; return parent::getLiveStats('inactive', $data); } public function url($endpoint) { return parent::normaliseurl($this->config->url).$endpoint; } }