Build and manage shopping cart functionality including adding items, calculating totals, and managing multiple cart instances.
Use this skill when implementing shopping cart features, e-commerce workflows, or wishlist management in Laravel applications using the realrashid/cart package.
vendor:publish tag: cart-config).use RealRashid\Cart\Facades\Cart;
Cart::add('id_1', 'Product 1', 2, 19.99, ['size' => 'L']);
Cart::update($rowId, 3); // Update quantity to 3
Cart::update($rowId, ['name' => 'New Product Name']); // Update other details
Cart::associate($rowId, 'App\Models\Product');
$item = Cart::get($rowId);
echo $item->model->name; // Access associated product model
$cartItems = Cart::content();
$total = Cart::total();
$tax = Cart::tax();
Cart::instance('wishlist') for multiple cart purposes within the same session.php artisan vendor:publish --tag=cart-config to customize default tax rates and storage settings.