Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
1,733
Widok
0
14/04/2022 3:43 pm
Topic starter
full error: Numeric value out of range: 1416 Cannot get geometry object from data you send to the GEOMETRY field
using: https://github.com/grimzy/laravel-mysql-spatial
laravel 8
how to fix
1 Answer
0
14/04/2022 3:44 pm
Topic starter
dont' forget to modify your model
namespace App; use Illuminate\Database\Eloquent\Model; use Grimzy\LaravelMysqlSpatial\Eloquent\SpatialTrait; /** * @property \Grimzy\LaravelMysqlSpatial\Types\Point $location * @property \Grimzy\LaravelMysqlSpatial\Types\Polygon $area */ class Place extends Model { use SpatialTrait; protected $fillable = [ 'name' ]; protected $spatialFields = [ 'location', 'area' ]; }
and remember that polygon array must have structure like
first_array_element == last_array_element