Analysis updated 2026-07-03
Add a shopping cart to a Laravel e-commerce site with support for multiple configurations of the same product.
Persist cart contents across user sessions by enabling the built-in database storage option.
Set up a separate wishlist alongside the main cart using multiple named cart instances.
Calculate and display order subtotals, tax amounts, and grand totals with custom number formatting.
| crinsane/laravelshoppingcart | kriswallsmith/assetic | openai-php/laravel | |
|---|---|---|---|
| Stars | 3,704 | 3,718 | 3,720 |
| Language | PHP | PHP | PHP |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 3/5 | 2/5 |
| Audience | developer | developer | developer |
Figures from each repo's GitHub metadata at analysis time.
LaravelShoppingcart is a PHP package that adds shopping cart functionality to web applications built with Laravel, a popular PHP web framework. It handles the common tasks any online store needs: adding products to a cart, updating quantities, removing items, calculating totals with tax, and wiping the cart clean when a purchase is complete. Adding items to the cart is straightforward. You pass in a product ID, name, quantity, and price. You can also attach extra options, like a size or color, so the same product can appear multiple times in the cart with different configurations. The package also supports a concept called a Buyable interface that lets your database model plug directly into the cart without manually specifying each field every time. The cart tracks each line item by a unique row ID. You use that ID to update quantities, swap in new product details, or remove the item entirely. To see everything currently in the cart, a content method returns a list of items you can display to the customer. Several built-in methods handle the math. A total method gives the grand total, a tax method returns the tax portion, and a subtotal method returns the total before tax. All three can be formatted with custom decimal and thousand separators. Tax rates are configurable via a config file. For more advanced use cases, the package supports multiple separate cart instances on one page (for example, a main cart and a wishlist), optional database storage so carts survive between sessions, and events that fire when items are added or removed. The README gives code examples for each of these features.
A PHP Laravel package that adds a full shopping cart to your web app: add items with options, update quantities, calculate tax and totals, and persist carts across sessions.
Mainly PHP. The stack also includes PHP, Laravel.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.