mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-22 06:49:35 +00:00
no message
This commit is contained in:
1 parent
fc02df862f
commit
3128d3657c
7 files changed
+147
-17
No files matched your search
@@ -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'];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user