username = Config::get('services.karat.username'); $this->password = Config::get('services.karat.password'); $this->endpoint = Config::get('services.karat.endpoint'); } private function doRequest($command) { $response = Http::withOptions([ 'debug' => true, 'verify' => false, ])->withBasicAuth($this->username, $this->password) ->post($this->endpoint, [ 'command' => $command, ]); return $response->json(); } public function getUsers() { return $this->doRequest('TM_GET_USERS'); } }