Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: saibotk <[email protected]>
  • Loading branch information
ahawlitschek and saibotk authored Jan 3, 2025
1 parent c0f77f1 commit f48aaf9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Added `Castable` to all geometries to use them as casters, instead of the `GeometryWKBCast`
- Added `Aliased` Expression class as wrapper for `AS` in query selects
- Add `->as()` helper method on MagellanBaseExpression
- Added `->as()` helper method on MagellanBaseExpression
- Added `withMagellanCasts()` as EloquentBuilder macro
- Added `AsGeometry` and `AsGeography` database expressions

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,8 @@ Since "hull" will return a geometry we need a cast for it. Instead of adding eac
$hullWithArea = Port::query()
->select([
'country',
ST::convexHull(ST::collect('location'))->('hull'),
ST::area(ST::convexHull(ST::collect('location')))->('area')
ST::convexHull(ST::collect('location'))->as('hull'),
ST::area(ST::convexHull(ST::collect('location')))->as('area')
])
->groupBy('country')
->withMagellanCasts() /* <======= */
Expand All @@ -485,8 +485,8 @@ $hullWithArea = Port::query()
$hullWithArea = Port::query()
->select([
'country',
ST::convexHull(ST::collect('location'))->('hull'),
ST::area(ST::convexHull(ST::collect('location')))->('area')
ST::convexHull(ST::collect('location'))->as('hull'),
ST::area(ST::convexHull(ST::collect('location')))->as('area')
])
->groupBy('country')
->withCasts(['hull' => Polygon::class]) /* <======= */
Expand Down

0 comments on commit f48aaf9

Please sign in to comment.