diff --git a/src/Cast/GeometryCast.php b/src/Cast/GeometryCast.php index 15afa03..072428c 100644 --- a/src/Cast/GeometryCast.php +++ b/src/Cast/GeometryCast.php @@ -48,6 +48,10 @@ public function get($model, string $key, mixed $value, array $attributes) if (! isset($value)) { return null; } + if ($value instanceof Geometry) { + $this->assertGeometryType($value); + return $value; + } // Detect format: WKB data is hex-encoded, WKT is human-readable text // After serialization, the model contains the WKB value, and we need to