geocoder-php / GeocoderLaravel

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

Only works whit IP's address #103

Closed AlejandroMendez closed 6 years ago

AlejandroMendez commented 6 years ago

General Information

GeocoderLaravel Version: Laravel Version: 5.4 PHP Version: 7.0 Operating System and Version: Elementary Loki

Issue Description

I tried to run the code that you put as example app('geocoder')->geocode('Los Angeles, CA')->get(); but is not working, the only thing that i noticed that works is when i put a ip address instead of the address "Los Angeles, CA", even when i put Lng, y Lat with command reverse is returned me an empty collection

Steps to Replicate

use Geocoder\Laravel\Facades\Geocoder; use Geocoder\Query\GeocodeQuery; $result = (app('geocoder')->geocodeQuery(GeocodeQuery::create('Buckingham Palace, London'))); dd($result);

mikebronner commented 6 years ago

Let me get back to you on this ... I am currently traveling and away from my desk computer for the next 2 weeks, but hopefully I can respond with an answer sooner than that.

mikebronner commented 6 years ago

I have tested your examples and they work in the unit tests. My best guess at this point is that there is a configuration issue with your system (perhaps it is missing CA chains to resolve the provider URLs securely, or there is a problem with OpenSSL or CURL on your system).

Unfortunately without an error log I cannot help. At this time my recommendation is to try your code on Ubuntu 16.04 and see if that works, better yet on a Laravel Homestead VM or Laravel Forge server.

Try running the unit tests on your machine, and I am willing to bet none of them work due to something not configured in your environment:

  1. Clone the package and CD into the package directory.
  2. Run composer update.
  3. Run vendor/bin/phpunit. If you only get one or two errors, try running the tests again (the providers occasionally will refuse connections from dev environments, I have found). I have always gotten all green on my tests running them the second time around.

I am closing this issue for now, as I have not been able to reproduce it in the environment it was meant to run in. Please re-open if you cannot get it to run on an Ubuntu server or Laravel Homestead.