matanyadaev/laravel-eloquent-spatial
Laravel Eloquent Spatial adds spatial data types and query functions to Eloquent models. Easily work with geometry, points, polygons, distances, and spatial indexes across MySQL and PostgreSQL, with expressive casts, scopes, and query builders.
Architecture fit
geometry, point, polygon, geography, etc.), adds Eloquent casts that translate between WKT/WKB/GeoJSON and PHP value objects, and exposes query-builder macros for spatial predicates (within, intersects, distance, orderByDistance).Integration feasibility
composer require + auto-discovery). Integration effort concentrates in two places: migrations (converting existing lat/lng decimals or raw WKT string columns into real geometry columns) and serialization (deciding whether APIs emit GeoJSON, WKT, or coordinates).brick/geo) — worth confirming which one the package version expects, since that becomes a second dependency to govern.Technical risk
Key questions
Stack fit
Migration path
ST_GeomFromText/ST_SetSRID, or ST_PointFromText on MySQL with SRID). Keep old columns readable and populated.Compatibility
Sequencing
Maintenance
brick/geo (or equivalent) value-object dependency must be tracked in parallel.Support
Scaling
SPATIAL INDEX on MySQL with an explicit SRID.ST_Within against an envelope, or && operators) before any ST_Distance filter or ORDER BY distance; unbounded distance sorts are the classic full-table-scan incident.Failure modes
Ramp-up
How can I help you explore Laravel packages today?