geocoder-php / GeocoderLaravel

Geocoder service provider for Laravel
http://geocoder-php.org/GeocoderLaravel/
MIT License
704 stars 102 forks source link

How to override Locale and API key on controller? #177

Closed elfeffe closed 4 years ago

elfeffe commented 4 years ago

This is more a question, is there any way to override the locale and the API?

mikebronner commented 4 years ago

Yes, you can do it either in config, or during runtime, as explained here: https://github.com/geocoder-php/Geocoder/pull/408#discussion_r24653135

Hope this helps :)

elfeffe commented 4 years ago

Thank you @mikebronner But that’s for a chain, it is not the same, right? How do you set locale here? app('geocoder')->geocode('Los Angeles, CA')->get();

mikebronner commented 4 years ago

@elfeffe You cannot set the locale on the query, you have to set it on the provider. The chain is like any other provider. Instead of chain in that example, you would need to spin up a GoogleMaps or Bing or whichever provider you want to use with your desired locale. Hope that helps?

elfeffe commented 4 years ago

Ok, thanks for your help