You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,16 +175,16 @@ return [
175
175
#### Bulk Operations
176
176
In order to insert or update several rows with spatial data in one query using the `upsert()` method in Laravel, the package requires a workaround solution to avoid the error `Object of class TarfinLabs\LaravelSpatial\Types\Point could not be converted to string`.
177
177
178
-
The solution is to use the `toGeomFromTextString()` method to convert the `Point` object to a WKT string, and then use `DB::raw()` to create a raw query string.
178
+
The solution is to use the `toGeomFromText()` method to convert the `Point` object to a WKT string, and then use `DB::raw()` to create a raw query string.
179
179
180
180
Here's an example of how to use this workaround in your code:
181
181
182
182
```php
183
183
use TarfinLabs\LaravelSpatial\Types\Point;
184
184
185
185
$points = [
186
-
['external_id' => 5, 'location' => (new Point(50, 20))->toGeomFromTextString()],
187
-
['external_id' => 7, 'location' => (new Point(60, 30))->toGeomFromTextString()],
0 commit comments