offline-agency/laravel-cart
| Install | |
|---|---|
composer require offline-agency/laravel-cart |
|
| Latest Version: | 4.2.0 |
| PHP: | ~8.4.0 || ~8.5.0 |
| Laravel: | 12 · 13 |
| Older releases: | 5 – 11 |
| License: | MIT |
| Last Updated: | Oct 19, 2026 |
| Links: | GitHub · Packagist |
Laravel Cart
A Laravel shopping cart with VAT, row/cart coupons, session or database persistence, API resources and testing helpers. Useful when your application owns its catalog and checkout. For inventory, payments, shipping and order management, evaluate a full commerce framework.
Requires PHP 8.4/8.5, BCMath and Laravel components ^12.69.2 or ^13.32. Latest published tag verified 16 October 2026: 4.1.0. This development branch adds unreleased tax allocation and recipe examples; see the capability/availability map. No next version is assigned.
Composer enforces the exact requirements; PHP prereleases and Laravel 10/11 are excluded.
composer require offline-agency/laravel-cart
use OfflineAgency\LaravelCart\Facades\Cart;
// Prices come from your trusted catalog, never from browser payable amounts.
$item = Cart::add(id: 1, name: 'Widget', qty: 2, price: 10.00, totalPrice: 12.20, vat: 2.20);
Cart::update($item->rowId, ['price' => 20.00]);
Cart::total(); // 48.80
See the maintained v4 docs, executable quick start, full reference, upgrade guide and contributing. The external documentation site is pending alignment with these sources.
Find practical variants/wishlist, Livewire, Inertia, API and Redis-session recipes.
Item coupons apply once per row. The additive, unreleased payableTaxBreakdown() allocates cart discounts into VAT; legacy vatBreakdown() stays before cart coupons. Built-in live mutations stage changes and database operations lock the complete read/modify/write boundary; storage guarantees and custom-driver limits explain their scope. Guest transfer is explicitly enabled; legacy saved snapshots remain a separate mechanism.
Reference links
Credits and license
Maintained by Offline Agency. Original package credits and contributors are preserved in the expanded reference. Released under the MIT license.
Related Packages
A package used to create and manage carts (such as shopping, recently viewed, co...
Version History
| Version | Released | PHP | Laravel | License |
|---|---|---|---|---|
| 4.2.0 | ~8.4.0 || | ^12.69.2 || | MIT | |
| 4.1.0 | ~8.4.0 || | ^12.69.2 || | MIT | |
| 4.0.3 | ~8.4.0 || | ^12.69.2 || | MIT | |
| 4.0.2 | ~8.4.0 || | ^12.69.2 || | MIT | |
| 4.0.1 | ~8.4.0 || | ^12.69.2 || | MIT | |
| 4.0.0 | ~8.4.0 || | ^12.69.2 || | MIT | |
| 3.2.0 | ^8.4 | ^10.0| | MIT | |
| 3.1.5 | ^8.4 | ^10.0| | MIT | |
| 3.1.4 | >=7.3 | ^5.0| | MIT | |
| 3.1.3 | >=7.3 | ^5.0| | MIT | |
| 3.1.2 | >=7.3 | ^5.0| | MIT | |
| 3.1.1 | >=7.3 | ^5.0| | MIT | |
| 3.1.0 | >=7.3 | ^5.0| | MIT | |
| 3.0.1 | >=7.3 | ^5.8| | MIT | |
| 3.0.0 | >=7.3 | ^5.8| | MIT | |
| 2.0.2 | >=7.3 | ^5.8| | MIT | |
| 2.0.1 | >=7.3 | ^5.8| | MIT | |
| 2.0.0 | >=7.3 | ^5.8| | MIT | |
| 1.0.4 | >=7.3 | ^5.8| | MIT | |
| 1.0.3 | >=7.3 | ^5.8| | MIT | |
| 1.0.2 | >=7.3 | ^5.8| | MIT | |
| 1.0.1 | >=7.3 | ^5.8| | MIT | |
| 1.0.0 | >=7.3 | ^5.8| | MIT | |
| 0.1.1 | >=7.3 | ^5.8| | MIT | |
| 0.1.0 | 5.1.*| | MIT |