diff --git a/.env.example b/.env.example index 59487c5..3c5d37c 100644 --- a/.env.example +++ b/.env.example @@ -7,7 +7,6 @@ APP_DEMO=false APP_DATE_TIME_FORMAT="Y-m-d H:i:s" PLOI_TOKEN= -PLOI_CORE_TOKEN= IMPERSONATION=false diff --git a/app/Services/Ploi/Ploi.php b/app/Services/Ploi/Ploi.php index 98148cb..6c046aa 100644 --- a/app/Services/Ploi/Ploi.php +++ b/app/Services/Ploi/Ploi.php @@ -23,11 +23,9 @@ class Ploi private $apiToken; - private $apiCoreToken; - protected PendingRequest $client; - public function __construct(string $token = null, string $coreApiToken = null) + public function __construct(string $token = null) { $this->url = config('services.ploi-api.url'); @@ -35,13 +33,7 @@ class Ploi $token = config('services.ploi.token'); } - if (!$coreApiToken) { - $coreApiToken = config('services.ploi.core-token'); - } - $this->setApiToken($token); - $this->setCoreApiToken($coreApiToken); - $this->buildClient(); } @@ -58,14 +50,6 @@ class Ploi return $this; } - public function setCoreApiToken($coreApiToken): self - { - // Set the token - $this->apiCoreToken = $coreApiToken; - - return $this; - } - public function buildClient(): static { $this->client = Http::baseUrl($this->url) @@ -73,7 +57,6 @@ class Ploi 'Authorization' => 'Bearer ' . $this->getApiToken(), 'Accept' => 'application/json', 'Content-Type' => 'application/json', - 'X-Ploi-Core-Key' => $this->getCoreApiToken(), ]); if (app()->isLocal()) { @@ -88,11 +71,6 @@ class Ploi return $this->apiToken; } - public function getCoreApiToken(): string - { - return $this->apiCoreToken; - } - public function makeAPICall(string $url, string $method = 'get', array $options = []): Response { if (!in_array($method, ['get', 'post', 'patch', 'delete'])) { @@ -134,7 +112,7 @@ class Ploi return new Response($response); } - public function server(int $id = null) + public function server(int $id = null): Server { return new Server($this, $id); } diff --git a/config/services.php b/config/services.php index f6aca35..10bdd93 100644 --- a/config/services.php +++ b/config/services.php @@ -32,7 +32,6 @@ return [ 'ploi' => [ 'token' => env('PLOI_TOKEN'), - 'core-token' => env('PLOI_CORE_TOKEN') ], 'ploi-api' => [