create(); $client = make(Client::class, [ 'config' => [ 'handler' => $stack, ] ]); $response = $client->get($url, ['timeout' => 2]); if ($response->getStatusCode() === 200) { return json_decode($response->getBody()->getContents(), true); } return []; } public static function post(string $url, array $data = []) { } }