Closed NickSun closed 1 year ago
Hi @NickSun. The code you attached doesn't reproduce the error. There's a chance you are not doing something correctly. Please fork this repo and add a failing test. It will help me to debug the issue and fix it.
@MatanYadaev you are right. I forgot to add HasSpatial trait to the model. Thanks!
Laravel: 10.1.5 matanyadaev/laravel-eloquent-spatial: 3.1.2
Query example:
Users::whereDistanceSphere('location', $user->location, '<', 20)->get()
Error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'distance_sphere' in 'where clause' (Connection: mysql, SQL: select * from `users` where `distance_sphere` = location)
What do I do wrong?