{"action":"opened","issue":{"url":"https://api.github.com/repos/spatie/geocoder/issues/54","repository_url":"https://api.github.com/repos/spatie/geocoder","labels_url":"https://api.github.com/repos/spatie/geocoder/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/spatie/geocoder/issues/54/comments","events_url":"https://api.github.com/repos/spatie/geocoder/issues/54/events","html_url":"https://github.com/spatie/geocoder/issues/54","id":378499540,"node_id":"MDU6SXNzdWUzNzg0OTk1NDA=","number":54,"title":"Possibly outdated \"Usage\" section in the ReadMe","user":{"login":"HeathMorrisCode","id":16902444,"node_id":"MDQ6VXNlcjE2OTAyNDQ0","avatar_url":"https://avatars2.githubusercontent.com/u/16902444?v=4","gravatar_id":"","url":"https://api.github.com/users/HeathMorrisCode","html_url":"https://github.com/HeathMorrisCode","followers_url":"https://api.github.com/users/HeathMorrisCode/followers","following_url":"https://api.github.com/users/HeathMorrisCode/following{/other_user}","gists_url":"https://api.github.com/users/HeathMorrisCode/gists{/gist_id}","starred_url":"https://api.github.com/users/HeathMorrisCode/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HeathMorrisCode/subscriptions","organizations_url":"https://api.github.com/users/HeathMorrisCode/orgs","repos_url":"https://api.github.com/users/HeathMorrisCode/repos","events_url":"https://api.github.com/users/HeathMorrisCode/events{/privacy}","received_events_url":"https://api.github.com/users/HeathMorrisCode/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-07T22:37:17Z","updated_at":"2018-11-07T22:37:17Z","closed_at":null,"author_association":"NONE","body":"Hello! Thank you for this and your other wonderful packages, they have made my life/work so much easier in the last few months. \r\n\r\nI think the instructions on the front page of the repo might be outdated or incorrect.\r\nFor the record my project is using Laravel 5.6.39\r\n\r\nThe first block of the Usage section for this package indicates this style of usage:\r\n\r\n> $client = new GuzzleHttp\\Client();\r\n> $geocoder = new Geocoder($client);\r\n> $geocoder->getCoordinatesForAddress('Infinite Loop 1, Cupertino', $apiKey);\r\n\r\nHowever, I was getting this error message from a CouldNotGeocode Exception:\r\n\r\n> Geocoding failed because `Keyless access to Google Maps Platform is deprecated. Please use an API key with all your API calls to avoid service interruption. For further details please refer to http://g.co/dev/maps-no-account`\r\n\r\nAnd PHPstorm indicated that getCoordinatesForAddress() only takes one parameter.\r\n\r\nWith my API key plugged into my Laravel .env, and config/geocoder.php correctly pointing to the constant inside the .env file, I figured I could try it without the $apiKey param, but I still received the same error.\r\n\r\nEventually I did this, and it worked like a charm:\r\n\r\n> $client = new Client();\r\n> $geocoder = new Geocoder($client);\r\n> $geocoder->setApiKey(env('GOOGLE_MAPS_GEOCODING_API_KEY'));\r\n> $geocoder->getCoordinatesForAddress('Infinite Loop 1, Cupertino', $apiKey);\r\n\r\nI wanted to mention this in case anyone else has the same issue and is banging their head against the wall.\r\n\r\nThanks again for the great packages!"}}
{"actor":{"display_login":"HeathMorrisCode"}}