Download the PHP package laratables/laravel-shipping without Composer
On this page you can find all versions of the php package laratables/laravel-shipping. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download laratables/laravel-shipping
More information about laratables/laravel-shipping
Files in laratables/laravel-shipping
Package laravel-shipping
Short Description A weight-based shipping cost calculator for Laravel with database-driven weight bands, free shipping thresholds, flat-rate fallback and a global on/off toggle.
License MIT
Homepage https://github.com/laratables/laravel-shipping
Informations about the package laravel-shipping
laratables/laravel-shipping
A weight-based shipping cost calculator for Laravel with database-driven weight bands, free shipping thresholds, flat-rate fallback, and a global on/off toggle.
Requirements
- PHP 8.2+
- Laravel 10, 11, 12 or 13
Note for Laravel 13 users: If you are developing on PHP 8.4 or 8.5 but deploying to a PHP 8.3 environment, add the following to your project's
composer.jsonto prevent Composer pulling Symfony 8 components that require PHP 8.4:This pins dependency resolution to PHP 8.3 so Composer keeps pulling Symfony 7.4 components compatible with your server.
Installation
Publish and run the migration:
Publish the config file:
Seed the default weight bands:
Usage
Resolving shipping for a cart
Cart item shape
Per-product priority rule
| weight_kg | shipping_cost | Result |
|---|---|---|
| set | any | Algorithm used, shipping_cost ignored |
| null | set | Flat rate used directly |
| null | null | Not shippable, skipped |
Product estimate
Using the Facade
Configuration
All settings are in config/shipping.php and driven by environment variables:
| Key | .env | Default | Description |
|---|---|---|---|
enabled |
SHIPPING_ENABLED |
true |
Master on/off toggle |
disabled_fallback.mode |
SHIPPING_DISABLED_MODE |
free |
free, flat_rate, or unavailable |
disabled_fallback.flat_rate_amount |
SHIPPING_FLAT_RATE_AMOUNT |
5.99 |
Fixed charge when mode is flat_rate |
base_fee |
SHIPPING_BASE_FEE |
2.50 |
Handling fee on every order |
multi_product_surcharge |
SHIPPING_MULTI_PRODUCT_SURCHARGE |
1.50 |
Added when cart has >1 product line |
heavy_item_threshold_kg |
SHIPPING_HEAVY_ITEM_THRESHOLD_KG |
10.0 |
Line weight that triggers heavy surcharge |
heavy_item_surcharge |
SHIPPING_HEAVY_ITEM_SURCHARGE |
3.00 |
Charge per heavy product line |
max_weight_kg |
SHIPPING_MAX_WEIGHT_KG |
100.0 |
Maximum shippable order weight |
free_enabled |
SHIPPING_FREE_ENABLED |
true |
Enable free shipping threshold |
free_threshold |
SHIPPING_FREE_THRESHOLD |
75.00 |
Subtotal needed for free shipping |
free_weight_limit_kg |
SHIPPING_FREE_WEIGHT_LIMIT_KG |
null |
Max weight still eligible for free shipping |
Weight bands
Bands are stored in shipping_weight_bands and managed from your admin panel. After updating bands, clear the cache:
Disabled modes
| Mode | Behaviour |
|---|---|
free |
All orders ship free |
flat_rate |
Fixed charge on every order |
unavailable |
Throws RuntimeException, block checkout |
Testing
License
MIT
All versions of laravel-shipping with dependencies
illuminate/support Version ^10.0|^11.0|^12.0|^13.0
illuminate/database Version ^10.0|^11.0|^12.0|^13.0
illuminate/cache Version ^10.0|^11.0|^12.0|^13.0