What's Changed
We are excited to finally release a huge overhaul on the DX with Laravel Magellan!
Please check out the upgrade guide for more recommended steps.
Breaking
- Removed support for deprecated Laravel versions 9.x & 10.x
- Require at least PHP 8.2
- Removed the
HasPostgisColumns
trait &$postgisColumns
property. - Removed
GeometryWKBCast
- Refactored
BBoxCast
to be generic & internal, please use Box subclasses directly - Removed automatic SRID transformation
- Removed st prefixed builder functions (e.g.
stSelect
,stWhere
, ...) - Removed
GeometryType
Enum - Renamed
toString
totoRawSql
onBox
classes - Removed Doctrine DBAL types & registration (was used for older Laravel versions)
GeometryGeojsonRule
is not directly invokable anymore
Added
- Added Laravel 12 & PHP 8.4 support
- Added
Castable
to all geometries to use them as casters, instead of theGeometryWKBCast
- Added
Castable
to all boxes to use them as casters, instead of theBBoxCast
- Added
Aliased
Expression class as wrapper forAS
in query selects- Added
->as()
helper method on MagellanBaseExpression
- Added
- Added
withMagellanCasts()
as EloquentBuilder macro - Added
AsGeometry
andAsGeography
database expressions - Added
fromString()
toBox
classes to create a box from a string - Added
Stringable
interface to all box classes - Added
JsonSerializable
toBox2D
andBox3D
Improved
- Validate the structure of Geometry coordinates to be an array in the
GeojsonParser
and fail if not - Use of ST functions directly in the Laravel default builder methods
- Use of ST functions directly in Model::create array
- Renamed parameters of ST functions that can receive geometry or geography from
$geometry
to$geometryOrGeography
- Geometry & Box implements
Expression
and therefore can be used in->select(...)
directly now
Fixed
- Fixed only using default PHP string precision in Box
toRawSql
methods, now uses the maximum precision
Removed
- Removed
magellan:update-postgis-columns
command - Removed
magellan.eloquent
&magellan.model_directories
configs
New Contributors
Full Changelog: 1.8.0...2.0.0