PHP code example of godmanshot / pasket

1. Go to this page and download the library: Download godmanshot/pasket 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/ */

    

godmanshot / pasket example snippets


use Pasket\Basket;

$basket = new Basket();
$basket->add(['id' => 1, 'name' => 'iPhone', 'price' => 1000]);
$basket->saveState();

use Pasket\Basket;

$basket = new Basket();
$basket->get(1); // id = 1

use Pasket\Basket;

$basket = new Basket();
$basket->get();

use Pasket\Basket;

$basket = new Basket();
$basket->delete(1); // id = 1
$basket->saveState();