Search by

offline-agency / laravel-cart

offlineagency

Laravel shopping cart with fiscal support

Package info

github.com/offline-agency/laravel-cart

pkg:composer/offline-agency/laravel-cart

Fund package maintenance!

offline-agency

Statistics

Installs: 1 832

Dependents: 0

Suggesters: 0

Stars: 2

Open Issues: 1

4.2.0 2026-10-19 21:14 UTC

README

Latest stable release Total downloads CI (main) Code coverage (main)

PHP 8.4 and 8.5 Laravel 12 and 13 PHPStan level max MIT license

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

Installation and publish tags

Configuration

Usage · Coupons · Storage

Credits and license

Maintained by Offline Agency. Original package credits and contributors are preserved in the expanded reference. Released under the MIT license.