File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -471,15 +471,15 @@ Place::create(['polygon' => $polygon]);
471471
472472$placeWithCentroid = Place::query()
473473 ->withCentroid('polygon')
474- ->withCast( 'centroid', Point:class) // This is important, otherwise the centroid will be returned as a binary string.
474+ ->withCasts([ 'centroid' => Point:: class] ) // This is important, otherwise the centroid will be returned as a binary string.
475475 ->first();
476476
477477echo $placeWithDistance->centroid; // POINT(0 0)
478478
479479// when using alias:
480480$placeWithCentroid = Place::query()
481481 ->withCentroid('polygon', 'centroid_alias')
482- ->withCast( 'centroid_alias', Point:class)
482+ ->withCasts([ 'centroid_alias' => Point:: class] )
483483 ->first();
484484
485485echo $placeWithDistance->centroid_alias; // POINT(0 0)
You can’t perform that action at this time.
0 commit comments