PHP code example of otobank / treasure

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

    

otobank / treasure example snippets




tobank\Treasure\Treasure;

$treasure = new Treasure([
    'host' => 'in.treasuredata.com',
    'writeKey' => 'YOUR_WRITE_ONLY_APIKEY_IS_HERE',
    'database' => 'DATABASE_NAME',
]);

$treasure->addRecord([
    'itemId' => 101,
    'saleId' => 10,
    'userId' => 1,
]);