isapp/laravel-cart
Laravel Cart is a customizable shopping cart package for Laravel with persistent database or session storage, guest and authenticated user support, high-precision price calculations, model associations, method chaining, and exception handling.
Product model, so the decision shifts from "how many sprints to build a cart" to "do we accept the constraints." That frees engineering capacity for the parts of commerce that actually differentiate — pricing rules, promotions, checkout flow.ItemAdded/ItemRemoved), guest→user cart merge, expired-session cleanup, item-count and total-quantity helpers. Each unchecked box is a work item your team must schedule or consciously defer. This is the single most useful artifact in the repo for planning.setUser() and setGuard() allow operating on someone else's cart — support agents rebuilding a lost cart, sales reps assembling an order for a customer, QA seeding states. This enables product surface area (an internal "rebuild this cart" tool) that would otherwise need bespoke code.Cart::extend(), and the Driver contract is small. That means "adopt now, replace the internals later" is a credible path — you can keep the facade surface your controllers depend on while swapping implementation, which lowers the cost of an early bet.Consider it when all of the following hold:
1.0.1 pins illuminate/support to ^13, and no compatibility matrix is published. On Laravel 11/12 you must deliberately pin an earlier tag rather than let Composer resolve.Product model can cleanly implement CartItemProduct — realistically meaning you can express price and tax as numeric strings from one model. If pricing lives across variants, price lists, or region-specific tables, the mapping gets awkward fast.users table uses bigint IDs, or you are willing to edit the published migration before running it. UUID/ULID primary keys require a migration change; catching this after php artisan migrate is a data problem.Look elsewhere, or build, when:
ItemAdded/ItemRemoved, abandoned-cart email, analytics funnels, and inventory reservation hooks must be wired manually at every call site — and that wiring drifts.Two verification steps before any commitment: confirm the release timeline is real and current (the listed last release is dated in the future — treat that as a signal to check Packagist directly rather than trust the summary), and run composer show isapp/laravel-cart to confirm the resolved version against your framework.
To executives: This is a small, MIT-licensed Laravel package that supplies standard shopping-cart mechanics — add, update quantity, remove, total — with correct decimal math and support for both guest and logged-in shoppers. Adopting it removes roughly the commodity portion of cart work from the roadmap and lets the team spend that time on checkout, pricing, and conversion instead. The trade-offs are honest: it is an early-stage dependency with no meaningful adoption yet, and four items we would eventually need — stock checks, cart events, guest-to-account cart merge, and stale-cart cleanup — are on the maintainer's own unfinished list. Recommendation: adopt for an MVP or internal tool where cart logic is not the differentiator, behind our own thin service wrapper so the package can be replaced without touching feature code. Do not adopt it as the foundation of a high-volume, promotions-heavy storefront without a spike first.
To engineering: The integration surface is small and legible. One interface on Product (CartItemProduct), one config file, one set of migrations, and a Driver contract you can read end to end in minutes. storeItem already increments on duplicate, so every "add to cart" button can hit one code path. Two things to handle deliberately: pin the version against your Laravel release (1.0.1 targets Laravel 13; earlier majors need an earlier tag), and inspect the migration's user_id column type before running it if we use UUIDs. Wrap the facade in our own cart service rather than calling Cart:: from controllers — that gives us one seam to add stock validation, fire our own domain events, and implement guest→user merge on login, all of which the package leaves to us. Treat price returns as strings end to end; do not cast to float in the view layer.
How can I help you explore Laravel packages today?