Skip to content

Commit 4ef3e23

Browse files
committed
Merge pull request mstaack#51 from OpusDevTeam/Fixed-PostgresBuilder-Dependencies
Fixed postgres builder dependencies & updating model attributes
2 parents fe880cd + 3d63781 commit 4ef3e23

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"illuminate/database": "^5.2",
1313
"geo-io/wkb-parser": "^1.0",
1414
"jmikola/geojson": "^1.0",
15-
"phoenixgao/laravel-postgres-extended-schema": "^0.14.0"
15+
"phoenixgao/laravel-postgres-extended-schema": "~0.15"
1616
},
1717
"require-dev": {
1818
"phpunit/phpunit": "~4.5",
1919
"mockery/mockery": "0.9.*",
20-
"satooshi/php-coveralls": "~0.6",
21-
"codeclimate/php-test-reporter": "dev-master",
20+
"satooshi/php-coveralls": "~1.0",
21+
"codeclimate/php-test-reporter": "~0.3",
2222
"illuminate/pagination": "~5.0"
2323
},
2424
"autoload": {

src/Eloquent/PostgisTrait.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public function newEloquentBuilder($query)
2323

2424
protected function performInsert(EloquentBuilder $query, array $options = [])
2525
{
26-
foreach ($this->attributes as $key => &$value) {
26+
foreach ($this->attributes as $key => $value) {
2727
if ($value instanceof GeometryInterface && ! $value instanceof GeometryCollection) {
2828
$this->geometries[$key] = $value; //Preserve the geometry objects prior to the insert
29-
$value = $this->getConnection()->raw(sprintf("ST_GeogFromText('%s')", $value->toWKT()));
29+
$this->attributes[$key] = $this->getConnection()->raw(sprintf("ST_GeogFromText('%s')", $value->toWKT()));
3030
} else if ($value instanceof GeometryInterface && $value instanceof GeometryCollection) {
3131
$this->geometries[$key] = $value; //Preserve the geometry objects prior to the insert
32-
$value = $this->getConnection()->raw(sprintf("ST_GeomFromText('%s', 4326)", $value->toWKT()));
32+
$this->attributes[$key] = $this->getConnection()->raw(sprintf("ST_GeomFromText('%s', 4326)", $value->toWKT()));
3333
}
3434
}
3535

0 commit comments

Comments
 (0)