phil/geolocation-bundle
A Symfony bundle for adding geolocation support to PHP applications. It provides configurable services for resolving and working with location data, making it easier to integrate geolocation features without building the underlying plumbing yourself.
lat/lng as decimals on the parent row, or in a separate locations table with history? (2) is an address reusable/shareable (many entities, one address) or owned? The bundle picks "address entity + attached coordinates," which is the right call if you expect multiple address types per user (billing, shipping, service) or want to dedupe on normalized address.DISTANCE/haversine functions are a useful reference for the cheap version of this: compute distance in the query, sort and filter in one round trip. That supports a scoping decision — "SQL-side haversine is good enough for v1 under ~tens of thousands of rows; a spatial index or PostGIS/MySQL 8 ST_Distance_Sphere is a later migration" — without paying for a spike.Consider it only as a reference artifact — an hour of reading during a discovery spike, to borrow the entity model and the SQL distance-function approach. Nothing more.
Explicitly do not adopt it as a runtime dependency if any of the following is true — which is all of them:
geocoder-php or a hosted provider (Mapbox, Google, Nominatim) for that.Look elsewhere when you need to actually ship:
| Need | Reasonable choice |
|---|---|
| Laravel, proximity/radius queries | clickbar/laravel-magellan (active, spatial types) or grimzy/laravel-mysql-spatial; raw PostGIS via ST_DWithin if you control the DB |
| Distance without spatial extensions | MySQL 8 ST_Distance_Sphere, or a hand-rolled haversine selectRaw — roughly 10 lines; the bundle's Doctrine functions are not worth porting |
| Address book modeling | Two tables (addresses, addressables pivot) plus a normalization step; a half-day of work |
| Geocoding | geocoder-php/geocoder with your provider of choice |
| Framework-agnostic geo math | Small first-party utility class; test it against known coordinate pairs |
To executives — one line: this is a ten-year-old, archived library with no maintainers and no adopters; we are not going to build on it. We are going to take roughly a day of design inspiration from it and then build or buy something current.
The business case in plain terms: geo features (store locator, serviceability checks, distance sorting) are on the roadmap regardless. The question is only how we get them. This package would add schedule risk — it targets a framework generation we do not run, and any security issue in it is ours to fix forever. The cost of doing it properly is small: a modern library is a dependency line in composer.json, and the fallback is a one-to-two sprint internal build using the same data model this bundle describes.
To engineering — the honest framing: the transferable assets are the schema (coordinates attached to entities, addresses as entities) and the pattern of a SQL-side distance function. The transferable code is near zero: it is a Symfony2 bundle, and the Doctrine functions are on the order of a few dozen lines of SQL you would write yourself. Do not attempt to shim the bundle into Laravel — budget the rewrite instead, because the DI and entity glue is the package and it does not survive the port.
Risk register items to state plainly: archived repository; last release 2015-01-09; 12 stars; 0 dependents; no PHP 8 support; EOL framework dependency; no security patching path. A low confidence score (0.06) on package quality is consistent with all of the above — treat it as a do not adopt signal, and if we cite it anywhere, cite it as a design reference with a link, not as a dependency.
Recommended next step: spend one hour reading the entity model during discovery, write a two-page design note (tables, distance strategy, prefilter thresholds), and pick a maintained library or an internal implementation before the sprint starts.
How can I help you explore Laravel packages today?