freepeace13/laraversine
A lightweight Laravel package for Haversine distance calculations. Compute great-circle distances between latitude and longitude points, then use them for nearby searches, radius filtering, or distance sorting in PHP applications.
Distance value object reduces bespoke formatting/comparison code; the clearer nearestFirst() error reduces misuse and support overhead.distance() accessor and value object make distance a first-class domain concept, which helps with consistent units, threshold comparisons, display formatting, and testability. That supports product requirements like “within 10 km” or “show distance to nearest location.”Distance value object via a distance() accessor and throws a clear error when nearestFirst() is called before nearby(). That makes proximity code more type-safe, testable, and easier to debug. It is a reasonable fit for straightforward Eloquent Haversine use cases; validate performance and maintenance risk before using it for high-scale or complex geospatial requirements.How can I help you explore Laravel packages today?