Forum

laravel: Cannot get...
 
Powiadomienia
Wyczyść wszystko

laravel: Cannot get geometry object from data you send to the GEOMETRY field

1 Wpisy
1 Użytkownicy
0 Reactions
1,999 Widoki
0
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
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

Twoja odpowiedź

Nazwa autora

E-mail autora

Twoje zapytanie *

 
Podgląd 0 rewizje Zapisano
Udostępnij: