Download the PHP package quankim/laravel-dynamodb-eloquent-syntax without Composer
On this page you can find all versions of the php package quankim/laravel-dynamodb-eloquent-syntax. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-dynamodb-eloquent-syntax
laravel-dynamodb-eloquent-syntax
Eloquent syntax for DynamoDB
Custom from https://github.com/baopham/laravel-dynamodb
Supports all key types - primary hash key and composite keys.
For advanced users only. If you're not familiar with Laravel, Laravel Eloquent and DynamoDB, then I suggest that you get familiar with those first.
Breaking Changes for v0.4
- If you're using v0.3 and below, please see here
- To upgrade to v0.4, please see the migration note
- Install
- Usage
- Indexes
- Composite Keys
- Test
- Requirements
- Todo
- License
- Author and Contributors
Install
-
Composer install
-
Install service provider:
- Put DynamoDb config in
config/aws.php
:
Usage
- Extends your model with
QuanKim\DynamoDbEloquentSyntax\DynamoDbModel
, then you can use Eloquent methods that are supported. The idea here is that you can switch back to Eloquent without changing your queries.
Supported methods:
- Or if you want to sync your DB table with a DynamoDb table, use trait
QuanKim\DynamoDbEloquentSyntax\ModelTrait
, it will call aPutItem
after the model is saved.
Indexes
If your table has indexes, make sure to declare them in your model class like so
Note that order of index matters when a key exists in multiple indexes.
For example, we have this
with
will use count_index
.
will use user_index
.
Composite Keys
To use composite keys with your model:
-
Set
$compositeKey
to an array of the attributes names comprising the key, e.g. - To find a record with a composite key
All versions of laravel-dynamodb-eloquent-syntax with dependencies
illuminate/support Version ~5.1
illuminate/database Version ~5.1