With this package baopham/dynamodb, you can do:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
class Campaign extends BaoPham\DynamoDb\DynamoDbModel
{
    protected $table = 'dynamodb_table_for_campaign';

    protected $fillable = ['name', 'description', 'status'];
}

$campaign = new Campaign();

$campaign->find('campaign-id'); // it's best to use UUID instead of incremented id - less work since you have to set the id attribute yourself.

// or
$campaign->where('name', 'foo')
        ->where('status', true)
        ->get();

// or
$campaign->first();

// or
$campaign->update(['name' => 'foo2', 'description' => 'bar2', 'status' => false]);

// or
$campaign->find('campaign-id')->delete();

For more, README, tests and code are available here: https://github.com/baopham/laravel-dynamodb

Comments