Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MatanYadaev committed Aug 3, 2024
1 parent 85c2e7f commit 0208bec
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/GeometryCast.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ public function set($model, string $key, $value, array $attributes): ?Expression
);
}

/** @var Geometry $value */

return $value->toSqlExpression($model->getConnection());
}

Expand Down
6 changes: 3 additions & 3 deletions tests/Objects/GeometryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
use MatanYadaev\EloquentSpatial\Enums\Srid;
use MatanYadaev\EloquentSpatial\GeometryExpression;
use MatanYadaev\EloquentSpatial\Objects\Geometry;
use MatanYadaev\EloquentSpatial\Objects\GeometryCollection;
use MatanYadaev\EloquentSpatial\Objects\LineString;
use MatanYadaev\EloquentSpatial\Objects\MultiPoint;
use MatanYadaev\EloquentSpatial\Objects\MultiLineString;
use MatanYadaev\EloquentSpatial\Objects\Polygon;
use MatanYadaev\EloquentSpatial\Objects\MultiPoint;
use MatanYadaev\EloquentSpatial\Objects\MultiPolygon;
use MatanYadaev\EloquentSpatial\Objects\GeometryCollection;
use MatanYadaev\EloquentSpatial\Objects\Point;
use MatanYadaev\EloquentSpatial\Objects\Polygon;
use MatanYadaev\EloquentSpatial\Tests\TestModels\TestPlace;

it('throws exception when generating geometry from other geometry WKB', function (): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public function up(): void
$table->timestamps();
$table->string('name');
$table->string('address');
$table->geometry('geometry')->isGeometry()->nullable();
$table->geometry('geometry')->nullable();
$table->point('point')->isGeometry()->nullable();
$table->multiPoint('multi_point')->isGeometry()->nullable();
$table->lineString('line_string')->isGeometry()->nullable();
Expand Down

0 comments on commit 0208bec

Please sign in to comment.