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.
composer require and, if the package ships one, publish its config: php artisan vendor:publish --tag="holidays-config". The config file is the first place to look after install — it holds the cache settings introduced in v1.1.3.tinker to confirm the locale/region wiring works, e.g. resolve holidays for your country and a date range, then dump the results. If you get an empty collection, your region code or locale is wrong far more often than the package is.if (in_array($date, $hardcodedHolidays)) check with the package's lookup, so business-day maths (SLA timers, invoice due dates, shipping cutoffs) stops being wrong on public holidays.BusinessCalendar (or similar) class that takes a region, exposes isHoliday(Carbon $date) and addBusinessDays(Carbon $date, int $n), and calls the package underneath. That gives you one place to swap regions, add company-specific shutdown days, and later change the package without a repo-wide search.php artisan holidays:warm style command (or a small custom one that iterates your supported regions) so the first request after a cache flush doesn't pay the cost. Good candidates: a Schedule::daily() entry, or a deploy hook step.Carbon business-day helpers carefully. Calculate business days yourself using holiday data rather than assuming addWeekdays() knows about holidays — it doesn't. A small helper that skips weekends and your holiday set is usually 15 lines and removes a whole class of off-by-one bugs.holidays.regions array in your own config keyed by tenant/country, and resolve the region from the request context rather than hardcoding 'US' in the service.php artisan cache:clear is too blunt, so tag or key-scope the holiday cache if the package allows it.->toDateString() or start-of-day in the holiday's timezone; comparing a UTC-midnight Carbon to a local-midnight holiday will fail intermittently near DST boundaries.array driver and production uses Redis, caching bugs only appear in one place. Test the cached path (make the same call twice) rather than assuming.between() inclusive?), and whether caching is masking a failed lookup by returning a cached empty array. Flush the specific key when in doubt.composer.json at least to ^1.1 so you actually receive the caching fix, and note the version in your README so the next developer knows why holidays appear stale after a data correction.How can I help you explore Laravel packages today?