Skip to content

Commit 0cbe61f

Browse files
authored
Update README.md
Fixed example usage of toGeomFromText() with DB::raw
1 parent df26ecd commit 0cbe61f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ Here's an example of how to use this workaround in your code:
183183
use TarfinLabs\LaravelSpatial\Types\Point;
184184

185185
$points = [
186-
['external_id' => 5, 'location' => (new Point(50, 20))->toGeomFromText()],
187-
['external_id' => 7, 'location' => (new Point(60, 30))->toGeomFromText()],
186+
['external_id' => 5, 'location' => DB::raw((new Point(lat: 40.73, lng: -73.93))->toGeomFromText())],
187+
['external_id' => 7, 'location' => DB::raw((new Point(lat: -37.81, lng: 144.96))->toGeomFromText())],
188188
];
189189

190190
Property::upsert($points, ['external_id'], ['location']);

0 commit comments

Comments
 (0)