Calling statically generating an error
Closed this issue · 2 comments
TheMonk commented
Hi,
Not sure if this is the right place. I've been trying to update aon older Laravel project and at the same time upgrade GeoCoder.
Here's the error I'm getting:
"Non-static method Geocoder\Geocoder::geocode() should not be called statically, assuming $this from incompatible context"
And it's being called from
$geocode = Geocoder::geocode($fullAddy);
$coords = $geocode->getCoordinates();
Any idea what could be causing the error? All docs seem to indicate this is the proper way to call Geocoder.
TheMonk commented
Note that I'm attempting to call this from a controller not sure if the syntax should be altered in that case.
TheMonk commented
The issue was the call in the controller. Instead of calling
Use Geocoder\Geocoder
Changed it to
Use Geocoder