Skip to content

Commit 45f278d

Browse files
authored
Update SpatialTrait.php
1 parent cfa1ff1 commit 45f278d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Eloquent/SpatialTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function performInsert(EloquentBuilder $query, array $options = [])
3737
foreach ($this->attributes as $key => $value) {
3838
if ($value instanceof GeometryInterface) {
3939
$this->geometries[$key] = $value; //Preserve the geometry objects prior to the insert
40-
$this->attributes[$key] = $this->getConnection()->raw(sprintf("GeomFromText('%s')", $value->toWKT()));
40+
$this->attributes[$key] = $this->getConnection()->raw(sprintf("ST_GeomFromText('%s')", $value->toWKT()));
4141
}
4242
}
4343

@@ -118,4 +118,4 @@ public function scopeBounding($query, Geometry $bounds, $column_name)
118118
{
119119
return $query->whereRaw("st_intersects(GeomFromText('{$bounds->toWkt()}'), `{$column_name}`)");
120120
}
121-
}
121+
}

0 commit comments

Comments
 (0)