kmlaravel/laravel-geographical-calculator
A Laravel/PHP package for geographical calculations, offering distance and radius queries between coordinates using Haversine and related formulas. Easily find nearby records, compute distances in multiple units, and add location-aware features to your Eloquent models with a simple, fluent API.
Baseline note: No prior assessment existed. This is a first-pass evaluation derived almost entirely from the v2.2.0 release notes; the package's name, repository, license, maintainer, and version-support matrix were not supplied and must be confirmed before any commitment.
Architecture fit
ST_Contains, or a dedicated geo index. Any workflow that filters large tables by geometry must stay in the database; this package cannot push predicates down to SQL.Integration feasibility
composer require, optionally a publishable config, and no schema migration. Effort is low; the real cost is validating geometric correctness, not wiring.Technical risk
farthest point on an empty set has no defined answer — behaviour (exception vs null vs INF) is unknown.Key questions
farthest point at 1k / 100k / 1M points?geocoder-php, brick/geo, or similar if those are in the stack?Stack fit
GeoService with farthestFrom() and contains()), so the package can be swapped for PostGIS, brick/geo, or a custom haversine implementation without touching call sites. This is the single highest-value integration decision given the unknowns.Migration path
composer.json constraints.^2.2) and commit the lockfile. Because v2.2.0 is additive, an in-place bump from 2.0/2.1 should be safe; if you are on 1.x, treat it as a major and re-verify the point/area API signatures.Compatibility
Sequencing
farthestFrom() and contains() behind your own interface; forbid direct package imports outside that namespace (enforce with a static-analysis rule).Maintenance
contains or distance as requiring re-running the characterisation suite.Support
Scaling
Failure modes
INF/NaN that propagates into business logic.memory_limit or breach request timeouts under load; the failure correlates with data growth rather than traffic, so it will not appear in load tests on small fixtures.null/exception handling) rather than trusting output.Ramp-up
How can I help you explore Laravel packages today?