abdulrhmanak/laracart

cart for e-commerce project in laravel

0.0.1 2023-09-13 11:55 UTC

This package is auto-updated.

Last update: 2024-09-13 14:32:03 UTC


README

Laracart is a cart package designed for Laravel e-commerce projects. This package provides powerful helpers to manage user carts in your e-commerce application.

How to Use:

  1. Make sure you have the required migrations for Product and User.

  2. Install the package using Composer:

    composer require abdulrhmanak213/laracart
    
    use Abdulrhmanak213\Laracart\Cart;
    

// Create a new cart instance $cart = new Cart();

// Show the cart for a specific user (by ID or session ID) $cart->show($id);

// Add a new product to the cart $cart->addProduct($product_id, $id, $quantity, $note);

// Remove a product from the cart $cart->removeProduct($product_id, $id);

// Decrease the quantity of a product in the cart $cart->decreaseProduct($product_id, $id);