Powiadomienia
Wyczyść wszystko
BugOverflow
1
Wpisy
2
Użytkownicy
0
Reactions
2,126
Widoki
0
14/04/2022 3:43 pm
Rozpoczynający temat
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 odpowiedź
0
14/04/2022 3:44 pm
Rozpoczynający temat
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
