offline-agency / laravel-cart
Laravel shopping cart with fiscal support
Fund package maintenance!
Requires
- php: ~8.4.0 || ~8.5.0
- ext-bcmath: *
- illuminate/auth: ^12.69.2 || ^13.32
- illuminate/console: ^12.69.2 || ^13.32
- illuminate/contracts: ^12.69.2 || ^13.32
- illuminate/database: ^12.69.2 || ^13.32
- illuminate/events: ^12.69.2 || ^13.32
- illuminate/http: ^12.69.2 || ^13.32
- illuminate/session: ^12.69.2 || ^13.32
- illuminate/support: ^12.69.2 || ^13.32
- nesbot/carbon: ^3.8
- nunomaduro/termwind: ^2.3
Requires (Dev)
- larastan/larastan: ^3.13
- laravel/pint: ^1.32
- mockery/mockery: ^1.6.15
- orchestra/testbench: ^10.12 || ^11.3
- pestphp/pest: ^4.7.8 || ^5.3.2
- pestphp/pest-plugin-laravel: ^4.1 || ^5.0.1
- phpstan/phpstan: ^2.3.1
Suggests
None
Provides
None
Conflicts
- symfony/translation: <7.2
Replaces
None
This package is auto-updated.
Last update: 2026-10-19 21:16:36 UTC
README
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.