We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I am using this to geocode an address and dump the results so I can see them:
$geocode = app('geocoder')->geocode('Los Angeles, CA')->get(); dd($geocode);
this works fine and I can see that it was successful as I can see all the geocoded results for LA.
When I try to begin accessing the results I get this error
Cannot access private property Geocoder\Model\AddressCollection::$addresses
This is using dd($geocode->addresses).
dd($geocode->addresses)
Ultimately I just want to get the latitude and longitude from my gecoded address - how do I do this?
The text was updated successfully, but these errors were encountered:
This might be one way of doing it:
$geocode = app('geocoder')->geocode('Los Angeles, CA')->get(); $latitude = $geocode->first()->getLatitude(); $longitude = $geocode->first()->getLongitude();
The items in geocode results collection use getters to retrieve values, instead of public properties. Here is the relevant documentation: https://github.com/geocoder-php/Geocoder#address--addresscollection.
Hope this helps you out a bit. Please feel free to re-open if you continue to have issues.
Sorry, something went wrong.
No branches or pull requests
I am using this to geocode an address and dump the results so I can see them:
this works fine and I can see that it was successful as I can see all the geocoded results for LA.
When I try to begin accessing the results I get this error
This is using
dd($geocode->addresses)
.Ultimately I just want to get the latitude and longitude from my gecoded address - how do I do this?
The text was updated successfully, but these errors were encountered: