1. Go to this page and download the library: Download ismail1k/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/ */
$cart = Cart::create($user_id = null); //It by default null but if you want to link that created cart to a specified user, You can pass `user_id` parameter.
Cart::add($cart_token, $product_id, $quantity = 1); //The default quantity is 1, that means if you don't specify the quantity, 1 will be added automatically.