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

Cart Laravel Package

escolalms/cart

Laravel package for EscolaLMS that provides shopping-cart models, migrations, and REST API endpoints for adding products, updating quantities, removing items, and calculating cart totals. Designed to plug into existing product, user, and checkout flows in an e-commerce application.

View on GitHub
Deep Wiki
Context7

Getting Started

Install via Composer (composer require escolalms/cart), then publish and run migrations and config (php artisan vendor:publish --provider="EscolaLMS\Cart\Providers\CartServiceProvider"). Start by inspecting routes/api.php for the cart and checkout endpoints, and src/Services/CartService.php for the domain logic. The quickest first use case is adding a product to the cart via the API (POST /api/cart or the package’s equivalent) and retrieving the current cart for an authenticated user. As of 0.4.81, the product/me response now includes a categories array, so any client consuming that endpoint can display category metadata without an extra request.

Implementation Patterns

Use the package’s service layer or facade rather than manipulating cart tables directly. For API-driven flows, authenticate the user and let the package resolve the active cart from the session or user record. When integrating product listings, call the product/me endpoint and rely on the new categories array for filtering or display. For checkout, listen to the package’s cart/order events to hook in payment, inventory, or notification logic. In admin or reporting contexts, reuse the same cart services to avoid duplicating pricing and tax rules. If you need custom product metadata (beyond categories), extend the product resource or add an accessor rather than modifying vendor migrations.

Gotchas and Tips

Cart persistence can differ between guest and authenticated users—confirm whether your configuration uses session-backed carts or database carts before assuming cart contents survive login. The new categories array on product/me may trigger additional queries; eager-load categories in any custom product queries to avoid N+1 issues. Watch for product availability and price recalculation when adding items, since cart totals are often recalculated on each request. For debugging, inspect the package’s service bindings and event listeners in the service provider; most behavior can be overridden via config or by binding your own implementation. If you rely on the product/me endpoint, verify that your API resource version matches 0.4.81+ so the categories key is present and not silently omitted by an older cached response.

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.
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console