geocoder-php/GeocoderLaravel

How to override Locale and API key on controller?

elfeffe opened this issue · 4 comments

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

Yes, you can do it either in config, or during runtime, as explained here: geocoder-php/Geocoder#408 (comment)

Hope this helps :)

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();

@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?

Ok, thanks for your help