lalalili / laravelshoppingcart
Shopping cart package for Laravel 11/12 with PHP 8.3+ support.
13.1.0
2026-03-02 17:38 UTC
Requires
- php: ^8.3
- illuminate/support: ^11.0|^12.0
- illuminate/translation: ^11.0|^12.0
- illuminate/validation: ^11.0|^12.0
Requires (Dev)
- mockery/mockery: ^1.6
- orchestra/testbench: ^9.0|^10.0
- pestphp/pest: ^4.0
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5|^12.0
This package is auto-updated.
Last update: 2026-03-02 18:17:59 UTC
README
Shopping cart package for Laravel 11/12 with PHP 8.3+ support.
Requirements
- PHP
^8.3 - Laravel
^11.0|^12.0
Installation
composer require lalalili/laravelshoppingcart:^13.0
Publish config:
php artisan vendor:publish --provider="Lalalili\\ShoppingCart\\ShoppingCartServiceProvider" --tag="config"
This publishes config/lalalili_shopping_cart.php.
Quick start
use Lalalili\ShoppingCart\Facades\ShoppingCartFacade; ShoppingCartFacade::session('user-1')->add([ 'id' => 'sku-001', 'name' => 'Sample Item', 'price' => 100, 'quantity' => 2, 'attributes' => [], ]); $total = ShoppingCartFacade::session('user-1')->getTotal();
Configuration key
v13 uses lalalili_shopping_cart config key.
config('lalalili_shopping_cart.decimals');
v13.x compatibility promise
v13.xis non-breaking only.- Existing public API names stay stable in v13:
- Facade:
ShoppingCartFacade - Service provider:
ShoppingCartServiceProvider - Container key:
shopping_cart - Config key:
lalalili_shopping_cart
- Facade:
- Breaking changes are deferred to
v14.
Breaking changes in v13.0.0
- Namespace changed from
Darryldecode\\Cart\\*toLalalili\\ShoppingCart\\*. - Facade changed from
CartFacadetoShoppingCartFacade. - Service provider changed from
CartServiceProvidertoShoppingCartServiceProvider. - Container binding key changed from
carttoshopping_cart. - Config key changed from
shopping_carttolalalili_shopping_cart. - Config publish target changed from
shopping_cart.phptolalalili_shopping_cart.php. - No legacy class aliases are provided.
Testing and quality
composer test
composer test:pest
composer analyse
Benchmark
composer bench
Latest local benchmark baseline (v13.x, PHP 8.4, synthetic data):
| Items | Add (ms) | Update (ms) | getTotal x10 (ms) | Peak memory (MB) |
|---|---|---|---|---|
| 100 | 37.79 | 0.36 | 1.93 | 4.00 |
| 1,000 | 87.80 | 2.98 | 15.57 | 4.00 |
| 10,000 | 870.79 | 29.15 | 164.92 | 12.00 |
Release flow
Release checklist is available at .github/ISSUE_TEMPLATE/release-checklist.md.
Standard flow:
milestone close -> tag -> release -> packagist ping -> smoke check
License
MIT