Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Distance Bundle

Distance Bundle Laravel Package

ns/distance-bundle

A Symfony bundle that provides reusable distance calculation services for PHP applications. Compute geographic distances between coordinates through a clean, dependency-injection-friendly API with configurable units and straightforward integration.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Distance Bundle
Is ns/distance-bundle compatible with Laravel?
No, not natively. Despite being described as a PHP package, ns/distance-bundle is structured as a Symfony bundle, so it relies on the Symfony dependency injection container, configuration tree, and bundle registration in bundles.php. Laravel has no equivalent mechanism and will not auto-register a service provider for it. To use it in Laravel you must either fork it and strip the Symfony scaffolding into a plain service class wrapped in a Laravel service provider, or write a thin adapter that avoids the Symfony container entirely.
How do I install ns/distance-bundle?
Installation is a standard Composer require of ns/distance-bundle. On a Symfony project you then register the bundle in config/bundles.php and configure the service through the bundle's configuration tree. On Laravel, the Composer install alone gives you nothing usable until you add your own service provider or adapter.
Which PHP and Symfony versions does ns/distance-bundle support?
This is unverified. The package has 0 stars, 0 dependents, and no downstream validation, so compatibility with current PHP and Symfony releases cannot be assumed. Check composer.json constraints and run it against your target versions before committing, because version drift is a realistic risk for an unmaintained package.
Where does the postal code coordinate data come from?
The overview does not say, and this is the most important architectural question about the package. Distance between postal codes implies a geocoding lookup layer turning codes into latitude and longitude before a haversine-style calculation, and that data could be a bundled dataset, an external geocoding API, or a user-supplied provider. Read the source to determine which, and confirm the licence and freshness of any bundled coordinate data before relying on it.
Which countries' postal codes does ns/distance-bundle support?
Coverage is country-specific and undocumented in the overview. Postal code formats and datasets vary heavily by country, and ambiguous or missing codes are a common failure mode. Test with real postal code pairs for every country your product serves rather than assuming global coverage.
How does ns/distance-bundle handle unknown or ambiguous postal codes?
Edge-case behaviour is not documented, so you must discover it by reading the source. Typically these libraries either throw an exception, return null, or silently fall back to a default, and each has different implications for your application. Validate the actual behaviour with invalid, partial, and international codes before shipping.
Is ns/distance-bundle safe to use in production?
Treat it with caution. It has 0 stars, 0 dependents, and a single maintainer, which means no evidence of production use, no battle-testing, and no ecosystem pressure to keep it current. It is feasible for a small, contained feature, but it should not become a load-bearing dependency without a deliberate fork-and-own decision.
Can I use ns/distance-bundle's distance calculation in Laravel without the Symfony container?
Yes, by treating the bundle as an internal library rather than a package. Extract the underlying distance service class, drop the Symfony bundle scaffolding, and bind it in a Laravel service provider. Do not attempt to run a Symfony bundle inside Laravel's container, since the two frameworks do not share container, event dispatcher, or configuration semantics.
Does ns/distance-bundle compute straight-line or road distance?
It computes geographic distance between coordinates, which almost certainly means straight-line haversine distance rather than road or routing distance. If your product needs driving distance, tolls, or travel time, this package will not deliver it and you need a routing service instead. Confirm the accuracy tolerance your feature requires before adopting it.
How should I test and de-risk ns/distance-bundle before integrating it?
Run a spike first. Write a throwaway script that computes distances between known postal code pairs and compares the results against a reference, such as haversine applied to authoritative coordinates. That de-risks the data dependency before any framework work. Then isolate the package behind your own DistanceCalculator interface so you can swap or replace the implementation later without touching call sites.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib
tacticmedia/scim-server-bundle
neika-ai/symfony-bundle
mattleads/agent-publishing-bundle
glavweb/framework-bundle