geocoder-php / GeocoderLaravel

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

`toJson()` not working on result set. #176

Closed mikebronner closed 4 years ago

mikebronner commented 4 years ago

General Information GeocoderLaravel Version: ^4.1 Laravel Version: 5.8.* PHP Version:>=^7.1.3 Operating System and Version: Windows 10 with Laravel

Issue Description I always receiving an Empty Collection.

Collection {#363 ▼ #items: [] }

Steps to Replicate use Geocoder\Laravel\Facades\Geocoder;

$result = Geocoder::geocode('Los Angeles, CA')->get();

dd($result);

Google Place API Key is provided, Any suggestions?

Originally posted by @HamzaB-coder in https://github.com/geocoder-php/GeocoderLaravel/issues/106#issuecomment-661045317

mikebronner commented 4 years ago

@HamzaB-coder I have been unable to reproduce the issue. I have the exact query in my unit tests, and it works fine. I'm fairly certain it is either a configuration issue or a conflict in your app. Please let me know if you can find out more.

HamzaB-coder commented 4 years ago

Well Thanks @mikebronner . i want to ask about google API-KEY Maybe there i have some problem..Please have a look on it

.env file

GOOGLE_MAPS_API_KEY=AIzaSyCWqA4vqXRP1M68-LRZ5XqmoU7GS_t4Ttg
# GOOGLE_MAPS_LOCALE=
HamzaB-coder commented 4 years ago

Hi @mikebronner I have done some work on debugging of my project and i found that its only doing geocoding of location ip-address e-g 8.8.8.8 for USA and 2.2.2.2 for FRANCE and 1.1.1.1 for Australia .. can you tell me where the problem i have??. thanks

mikebronner commented 4 years ago

It looks like your API Key is bad. Nothing worked when using it. I put my own back in, and it worked fine. Make sure you get the API Key from here: https://developers.google.com/maps/documentation/javascript/get-api-key and make sure the configured restrictions aren't preventing it from working for you.