I have been trying to connect .with guzzle on project in other like this -
$http = new Guzzle;
return $http->get('http://my-project-api/api/options')->getBody();
but It shows this error -
GuzzleHttp\Exception\ConnectException: cURL error 6: Could not resolve host: my-project-api
I saw this post -
I saw this reference -
https://github.com/laradock/laradock/issues/435
that a lot of developers are trying to connect .
I could abstract some things from there , but as I dont have many experience with Docker . I could not understand a lot of things .
In my /etc/hosts ( I am using linux desktop ), I tried to change for -
127.0.0.1 my-project-api
or
172.19.0.1 my-project-api
( I got this IP inspecting the nginx container , I found there - "Gateway": "172.19.0.1" . I can access by postman and in chrome , but not with Guzzle )
or
172.18.0.1 my-project-api
( I got this IP inspecting - laradock_backend network , I found there - "Gateway": "172.18.0.1" . I can access by postman and in chrome , but not with Guzzle )
all those IPS connect with the api with chrome and with postman , but not with Guzzle .
Does have any IP in laradock taht I can access other API with Guzzle ?
In that refrence , I could find other methods , but I could not understand . I am using laradock with nginx .