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
Delivery Calculator

Delivery Calculator Laravel Package

contoweb/delivery-calculator

A Laravel package for calculating delivery costs with configurable rules and pricing. Integrate flexible shipping calculations into your app and present accurate delivery estimates at checkout.

View on GitHub
Deep Wiki
Context7

Calculate a DateTime by providing a start DateTime and a delivery duration in hours considering business hours, weekends and defined holidays.

Frequently asked questions about Delivery Calculator
How do I install contoweb/delivery-calculator with Composer?
Install it with composer require contoweb/delivery-calculator. Laravel package auto-discovery registers the service provider, so manual provider entry is usually unnecessary. Publish any package config if the README instructs it, then define your delivery rules and call the calculator from your checkout or order service.
How does the package match delivery rules by weight and order total?
Rules are evaluated against the order context you pass in, including weight and order total. Each rule describes the criteria it matches and the delivery price it returns, so overlapping tiers resolve in a deterministic order. Keep your rule set small and explicit to avoid ambiguous matches.
Can I calculate delivery costs based on destination or country?
Yes. Destination is one of the supported matching criteria alongside weight and order total, so you can create country, region, or zone-specific rules. Combine destination with value or weight thresholds to model realistic shipping tables. Always include a catch-all fallback rule for destinations your table does not cover.
Which Laravel versions does contoweb/delivery-calculator support?
The package is built for Laravel integration and installs through Composer with package auto-discovery. The overview does not document a hard framework-version matrix, so check the composer.json constraints in the repository before upgrading a major Laravel version. For older or non-standard setups, verify service provider registration and config publishing manually.
How do I add custom delivery calculation logic?
The package ships extensible calculators so you can implement business logic the built-in rules do not cover. The usual approach is to extend the calculator or add a custom rule type that receives the order context and returns a price. Keep custom logic behind your own adapter so application code does not bind directly to package internals.
How do I test delivery price calculations in a Laravel app?
It is a lightweight, testable PHP implementation, so you can unit test rule matching and price resolution without a full HTTP request. Build fixtures for typical orders, boundary weights, and unmatched destinations. Put the calculator behind a small service wrapper and test that wrapper rather than scattering assertions across call sites.
What happens when no delivery rule matches an order?
The overview does not specify missing-rule behavior, so treat it as an explicit design decision. The safest pattern is a final catch-all rule that returns a default delivery price or marks the order as needing manual review. Add a test for the unmatched case so a configuration change cannot silently return an invalid price.
Is contoweb/delivery-calculator suitable for production checkout?
It fits well as a leaf-level domain utility rather than an architectural pillar. Wrap it in an application-side delivery service so checkout, admin, and API call sites share one adapter boundary. The main production risks are incomplete rule coverage and ambiguous overlapping rules, both controlled with tests and a fallback rule.
How does it compare to carrier shipping rate APIs for Laravel?
This package is for deterministic, rule-based delivery pricing from your own configuration. It is not a carrier integration, so it will not fetch live rates from DHL, UPS, or similar providers. If you need live carrier quotes, use a carrier SDK and keep this package for table-based or fallback pricing.
How do I configure delivery pricing tiers?
Pricing tiers are expressed as configurable delivery rules, usually ranged by weight, order total, or destination. Define the tiers so ranges do not overlap ambiguously, and order them so the most specific rule wins. Publish and version the config like application code, then cover each tier boundary with a test.
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.
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource
noith/settings