PHP code example of lee-to / laravel-cart

1. Go to this page and download the library: Download lee-to/laravel-cart library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lee-to / laravel-cart example snippets


Cart::get();

Cart::userCarts(optional USER_ID);

Cart::add(PRODUCT_ID, optional [VARIANT_ID_1, VARIANT_ID_2]);

Cart::quantity(CART_ITEM_ID, NEW_COUNT);

Cart::total();

Cart::count();

Cart::remove(CART_ITEM_ID);

Cart::flush();