no message

This commit is contained in:
StudioTem committed 2023-02-27 15:32:59 +01:00
1 parent fc02df862f
commit 3128d3657c
7 files changed
+147 -17

No files matched your search

+11 -11
View File
@@ -10,38 +10,38 @@ class Api
/**
* @var array|mixed
*/
private mixed $username;
private static mixed $username;
/**
* @var array|mixed
*/
private mixed $password;
private static mixed $password;
/**
* @var array|mixed
*/
private mixed $endpoint;
private static mixed $endpoint;
public function __construct()
{
$this->username = Config::get('services.karat.username');
$this->password = Config::get('services.karat.password');
$this->endpoint = Config::get('services.karat.endpoint');
self::$username = Config::get('services.karat.username');
self::$password = Config::get('services.karat.password');
self::$endpoint = Config::get('services.karat.endpoint');
}
private function doRequest($command)
private static function doRequest($command)
{
$response = Http::withOptions([
'debug' => true,
'verify' => false,
])->withBasicAuth($this->username, $this->password)
->post($this->endpoint, [
])->withBasicAuth(self::$username, self::$password)
->post(self::$endpoint, [
'command' => $command,
]);
return $response->json();
}
public function getUsers()
public static function getUsers()
{
return $this->doRequest('TM_GET_USERS');
return self::doRequest('TM_GET_USERS')['users'];
}
}