Level 60
https://docs.guzzlephp.org/en/stable/quickstart.html
something like this
new Client([
'base_uri' => $this->url,
]);
key and location are in wrong place I guess
May Sale! All accounts are 40% off this week.
Hey, I tried to configurate a constructor for google maps api with Guzzle client but I have some problems with him I got this error
TypeError: Argument 1 passed to GuzzleHttp\Client::__construct() must be of the type array, string given, called in /var/www/html/app/Services/GoogleMapsAreaService.php on line 19 in file /var/www/html/vendor/guzzlehttp/guzzle/src/Client.php on line 57
private $googleMapsApi;
private $url = 'http://maps.googleapis.com/maps/api/geocode/json?address';
private $key = 'xxxx';
private $location;
public function __construct()
{
$this->googleMapsApi = new Client($this->url, [
'key' => $this->key,
'location' => $this->location
]);
}
Please or to participate in this conversation.