-
Notifications
You must be signed in to change notification settings - Fork 106
Receiving an Empty Collection #104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What version of Mac are you on? |
hi Mike, I’m on Sierra and the newest Version of Laravel Valet. I’m try the code on my webserver later this day. |
Yea, Sierra has/had? a problem with OpenSSL, so it didn't complete the request. If you run it in Homestead it should work (and of course on your server as well). This works fine under High Sierra, I would recommend upgrading if you have no other issues with High Sierra. |
hey, mike. I tried the same on my web server. But unfortunately with the same results. Just an empty collection. GeoCode Method - Image Code
Same results with the reverse method. Maybe i'm missing something out of the configuration. What I'm doing atm:
Cheers, Stan |
What is your server OS and version? |
@mikebronner - Its an Ubuntu 16.04.1 LTS |
@mikebronner Maybe i'm missing out something else, because when i remove the API KEY in the env file i'm getting the same result. What I'm doing atm:
|
Did you follow step 5 in the 0.x to 1.0 upgrade notes? Try using |
Hi Mike, yes I'm not using a previous version of your package but also tried to run it directly with the provided command:
Unfortunately the same result. |
But it's the only one from the provided commands. |
Have you tried them all on your server? The others probably won't work on Sierra, like I mentioned earlier. It works perfectly in High Sierra: php artisan tinker
Psy Shell v0.8.11 (PHP 7.1.9 — cli) by Justin Hileman
>>> dd(app('geocoder')->geocode('Los Angeles, CA')->get());
Illuminate\Support\Collection {#914
#items: array:1 [
0 => Geocoder\Provider\GoogleMaps\Model\GoogleAddress {#903
-id: "ChIJE9on3F3HwoAR9AhGJW_fL-I"
-locationType: "APPROXIMATE"
-resultType: array:2 [
0 => "locality"
1 => "political"
]
-formattedAddress: "Los Angeles, CA, USA"
-streetAddress: null
-intersection: null
-political: "United States"
-colloquialArea: null
-ward: null
-neighborhood: null
-premise: null
-subpremise: null
-naturalFeature: null
-airport: null
-park: null
-pointOfInterest: null
-establishment: null
-subLocalityLevels: Geocoder\Model\AdminLevelCollection {#905
-adminLevels: []
}
-coordinates: Geocoder\Model\Coordinates {#917
-latitude: 34.0522342
-longitude: -118.2436849
}
-bounds: Geocoder\Model\Bounds {#918
-south: 33.7036519
-west: -118.6681759
-north: 34.3373061
-east: -118.1552891
}
-streetNumber: null
-streetName: null
-subLocality: null
-locality: "Los Angeles"
-postalCode: null
-adminLevels: Geocoder\Model\AdminLevelCollection {#919
-adminLevels: array:2 [
1 => Geocoder\Model\AdminLevel {#920
-level: 1
-name: "California"
-code: "CA"
}
2 => Geocoder\Model\AdminLevel {#921
-level: 2
-name: "Los Angeles County"
-code: "Los Angeles County"
}
]
}
-country: Geocoder\Model\Country {#922
-name: "United States"
-code: "US"
}
-timezone: null
-providedBy: "google_maps"
}
]
}``` |
Unfortunately yes. This following comand is the only i get working.
|
@mikebronner Is there a way I can provide you some log files or access to the server or application? I try to dig into the package a little deeper when i'm at home later to check the package-code by myself as well. The only thing i'm not getting is why i get an empty collection even if i provide no API_Key. So maybe there is something i'm missing out before its running the actual query. |
Did you remove the alias and provider entries from your An empty collection is returned when a result cannot be found, for whatever reason. Please empty your Clone the repo to a folder and try running all the unit tests:
|
Tinker Unit Tests I replaced my API:Key in your Test-Package to make sure the my key is correct. That worked fine, even with an broken key i got the appropriate error response. Try your TestCode inside my App
With the same results: Empty collection. Cheers, Stan |
@StanBarrows you didn't answer if you made sure that you weren't manually registering the provider and alias? I can't really help with configuration issues without having a stacktrace or other information. My recommendation at this point is to read the README in detail and follow it EXACTLY on a new project, and see if it works there. If it does, see what you did differently, or perhaps what might be conflicting with it. |
@mikebronner Sorry for that, I re-arranged my comments and forgot to past it back in. Yes, I made sure everything was setup from scratch and the Providers and Facades were removed. At last step i can give it a shot on a completely new project. Cheers, Stan |
After a restart and clearing ALL possible caches it worked! Thanks for your help and patience. Glad i can user your awesome work now! I think it's maybe worth to mention somewhere in the documentation again to clear all caches after every possible change on the query. Cheers Stan |
Good to hear! Yea, I will update the documentation and also create another issue to look into the caching mechanism to make sure that the cache keys are unique. |
Locking back, I'm sure it was a caching problem and I fixed the query maybe after your first post 👍 |
Thanks for mentioning that @mikehins :) |
@StanBarrows |
|
General Information
GeocoderLaravel Version: ^4.0
Laravel Version: 5.5.*
PHP Version:>=7.0.0
Operating System and Version: Mac with Laravel Valet
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?
The text was updated successfully, but these errors were encountered: