spine/spine-trigonometric-dql-bundle
Spine Trigonometric DQL Bundle adds trigonometric functions to Doctrine Query Language, letting you use sine, cosine, tangent, and related math operations directly in DQL. Keep calculations database-side and queries cleaner with simple integration into Spine/Doctrine projects.
SIN, COS, TAN, ACOS, ASIN, ATAN, RADIANS, DEGREES, PI (and typically ATAN2) to Doctrine's DQL, which is the missing primitive for computing great-circle distances and bearings inside SQL. That unblocks "stores near me," nearest-warehouse routing, radius filters, and map clustering without a separate geospatial stack (no PostGIS, no Elasticsearch geo queries).Consider it when all of the following hold:
laravel-doctrine.ORDER BY distance. You are not doing polygon containment, routing, or spatial indexing.WHERE keeps the trig calls off the full table.Look elsewhere when:
ST_Distance_Sphere, Sphinx/Elasticsearch geo, or a managed geo API. Those are faster, indexed, and far better supported.whereRaw with ST_Distance_Sphere or raw haversine SQL instead.For executives: We can add "stores near me" / "nearest location" capability with a small, focused library that extends our existing database query language with the math needed to compute distances. It avoids standing up a new geo platform and keeps the logic inside queries we already run, which means faster pages and less new infrastructure. The caveat is maturity: this is an unmaintained, essentially unused open-source component, so the real cost is not licensing but ownership — we should treat it as a spike and be prepared to vendor and maintain roughly a few hundred lines ourselves.
For engineering: This is a Symfony/Doctrine bundle registering trigonometric DQL functions — nothing Laravel-native. Value is precisely that it removes the "fetch all rows, compute in PHP" pattern for distance sorting and radius filters. Risks: unmaintained, no test/compat guarantees, and trig-in-ORDER BY defeats indexes, so require a bounding-box prefilter and a composite lat/lng index. Recommendation: 1–2 day spike against our current PHP and Doctrine versions; if it holds, vendor the function classes into our codebase with our own tests rather than depending on the upstream repo. If the spike surface friction or if the geo roadmap grows beyond "distance and sort," skip it and go to PostGIS or a geo search service.
How can I help you explore Laravel packages today?