src/MastodonClient.php
public function call(string $method, string $api, array $options = []): array
    {
        $url = $this->apiEndpoint() . $api;

        if (!empty($this->token)) {
            Arr::set($options, 'headers.Authorization', 'Bearer ' . $this->token);
        }

        $this->response = $this->client->request($method, $url, $options);

        return json_decode(optional($this->response)->getBody(), true);
    }
public function call(string $method, string $api, array $options = []): array
    {
        $url = $this->apiEndpoint() . $api;

        if (!empty($this->token)) {
            Arr::set($options, 'headers.Authorization', 'Bearer ' . $this->token);
        }

        $this->response = $this->client->request($method, $url, $options);

        return json_decode(optional($this->response)->getBody(), true);
    }
@param string $method
@param string $api
@param array  $options

@return array