Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Laravel Cart

Laravel Cart Laravel Package

wearepixel/laravel-cart

A Laravel shopping cart package for managing cart items, quantities, prices, and totals with flexible storage options. It provides a simple API for adding, updating, and removing items, making it easy to integrate into ecommerce checkout flows.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Laravel Cart
How do I install wearepixel/laravel-cart in a Laravel application?
Install the package with Composer, then publish its configuration using the cart-config tag and choose a cart driver. The publish tag is cart-config in the major release, so older deploy scripts using --tag=config will not publish the cart config. Check the repository README for the exact service provider registration and environment variables. After publishing, select session, database, Redis, null, or multi storage depending on your deployment.
Which storage drivers does laravel-cart support and how do I choose between session, database, Redis, and multi?
The package provides a CartDriver abstraction managed by CartManager, with Session, Database, Redis, Null, and Multi implementations. Use Session for simple single-node apps, Database for durability, Redis for a fast hot path, and Null for tests or disabled carts. MultiDriver implies read/write composition such as Redis plus Database, but the release notes do not describe its consistency or fallback semantics, so validate that behavior before production use. The driver approach replaces the removed CartSession class.
Is wearepixel/laravel-cart compatible with Laravel 13 and which PHP versions are supported?
Laravel 13 support is claimed, but it is not clear whether that is tested against a GA release or a pre-release target, so verify it on a stable framework version. Minimum PHP and Laravel versions are not specified in the available information; check composer.json and the README. Because this is a major release with breaking changes, confirm version constraints before upgrading an existing application.
How do I test Laravel cart code with Cart::fake and CartFactory?
The package includes Cart::fake(), CartFactory, and assertion methods specifically to reduce bespoke test scaffolding in consuming applications. Use Cart::fake() to swap the real cart implementation in tests, then build cart states with CartFactory and assert on items, quantities, prices, and totals. This harness also improves coverage of the package's own contract. Check the README for the exact assertion methods available in your installed version.
What breaking changes are in the new laravel-cart major release and how do I migrate from CartSession?
Three changes are breaking: CartSession is removed in favor of the driver system, the Cart constructor now requires a CartDriver, and the config publish tag was renamed from config to cart-config. Container-resolved usage should keep working, but direct new Cart(...) calls, factory overrides, test doubles, type-hints, extensions, and container bindings of CartSession will break. Deploy scripts using vendor:publish --tag=config will silently stop publishing the cart config. Treat this as a major upgrade with a real migration step rather than a drop-in replacement.
How do I add coupons, tax rules, and shipping rates to a Laravel shopping cart?
The release adds first-class Coupon, TaxRule, and ShippingRate abstract classes for modelling these concepts. They formalise what was previously ad-hoc CartCondition construction and convert down to CartCondition, so the existing condition engine is preserved. That means you can define coupons, tax, and shipping as domain objects while keeping compatibility with condition-based cart totals. Review the package examples to see how each abstraction maps to CartCondition.
Why did my Redis cart TTL become much shorter after upgrading laravel-cart?
The Redis TTL fix corrects the unit from minutes to seconds, so any existing configured TTL value is now interpreted as up to 60 times shorter. Carts will expire far earlier than before the deploy, which is a production-visible change. Audit every TTL configuration value before releasing the upgrade and adjust it to the intended seconds value. This is not a silent bug in your app; it is a unit correction in the package that must be planned for.
What happens to carts stored before the laravel-cart condition serialization change?
Conditions are now serialized to arrays before storage, so carts persisted before the upgrade may contain PHP-serialized objects that the new code path reads differently. The risk window is in-flight carts at deploy time, with possible silent data loss or a thrown deserialization error. No migration command is described in the available information, so plan a drain-and-deploy or test restoration against a copy of production data. Do not assume existing carts will deserialize cleanly without verification.
Does the laravel-cart database driver include publishable migrations and a documented schema?
It is not clear from the available documentation whether DatabaseDriver ships publishable migrations, what the schema looks like, or how schema changes are versioned. Check the repository before choosing database storage for production, and review any migrations for indexes and column types that match your cart volume. If migrations are not included, you will need to own the schema and its evolution. Treat schema versioning as a maintenance risk until the package documents it.
Is wearepixel/laravel-cart production-ready and actively maintained?
The package has good hygiene signals such as PHPStan level 5 with zero errors and restored @mixin/@method PHPDoc for IDE and static analysis support. However, this major release has a single contributor, so bus factor and review depth are legitimate concerns. The cart:debug command is stated as non-production only, so confirm its guard is environment-based and not easily flipped by an operator. Verify Laravel 13 support against a stable release and audit the breaking changes before adopting it in production.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin