Skip to content

Commit

Permalink
api token in auth.
Browse files Browse the repository at this point in the history
  • Loading branch information
Saifallak committed Aug 4, 2024
1 parent 46727c1 commit 20ab51f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/Cloudwa.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ public function session(?string $sessionUuid): static
return $this;
}

public function token(?string $apiToken): static
{
$this->headers['Authorization'] = 'Bearer '.($apiToken ?? config('cloudwa.api_token'));

return $this;
}

public function throw(bool $throwOnException = true): static
{
$this->throwOnException = $throwOnException;
Expand Down

0 comments on commit 20ab51f

Please sign in to comment.