PHP code example of seba / pantry

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

    

seba / pantry example snippets


$pantry = new new \Pantry\Client("YOUR_PANTRY_ID");

$basket = $pantry->createBasket("ILoveThisBasket", [
    "key" => "value"
]);

$basket = $pantry->getBasket("ILoveThisBasket"); // Get the basket instance
echo $basket; // The basket data as a json string
var_dump($basket); // The basket data as an object
$basketData = $basket(); // The basket data as an object
$basketData = $basket->get(); // The basket data as an object

$basket->update([
    "newKey" => "newValue"
]);

$basket->delete();

echo $pantry; // The pantry data as a json string
var_dump($pantry); // The pantry data as an object
$pantryData = $pantry(); // The pantry data as an object
$pantryData = $pantry->getData(); // The pantry data as an object