PHP code example of guillermoandrae / php-dynamodb

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

    

guillermoandrae / php-dynamodb example snippets


 declare(strict_types=1);

ynamoDbAdapter;
use Guillermoandrae\DynamoDb\Constant\AttributeTypes;
use Guillermoandrae\DynamoDb\Constant\KeyTypes;

try {

    // create a new table
    $adapter = new DynamoDbAdapter();
    $adapter->useTable('myTable')->createTable([
        'year' => [AttributeTypes::NUMBER, KeyTypes::HASH],
        'title' => [AttributeTypes::STRING, KeyTypes::RANGE],
    ]);

} catch (\Exception $ex) {
    die($ex->getMessage());
}

composer 
shell script
php ./examples/tables.php