Skip to content
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

Call to undefined method Grimzy\LaravelMysqlSpatial\Eloquent\SpatialExpression::getLat() #171

Open
pelmered opened this issue Apr 26, 2021 · 0 comments

Comments

@pelmered
Copy link

There is an issue with the same error, but I don't think they are related. Here is that issue: #88
The solution proposed in that issue is also far from optimal and would require quite a lot of work to implement across the application, and it's really ugly.

I've been using this package a lot but suddenly I started to get this error.

The code is very simple:

        $homeAddress = $this->homeAddress()->first();
        $lat = $homeAddress->location->getLat();
        $lng = $homeAddress->location->getLng();

I have upgraded Laravel to 8.38.0 (was 8.33.1 before) and this package from 4.0 to 5.0 along with some major refactoring so it's a bit hard to track down exactly what caused this.

If I just add this to SpatialExpression, everything works fine:

    public function getLat()
    {
        $this->value->getLat();
    }
    public function getLng()
    {
        $this->value->getLng();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant