<commit_before>laravel-dynamodb
================

[![Latest Stable Version](https://poser.pugx.org/baopham/dynamodb/v/stable)](https://packagist.org/packages/baopham/dynamodb)
[![Total Downloads](https://poser.pugx.org/baopham/dynamodb/downloads)](https://packagist.org/packages/baopham/dynamodb)
[![Latest Unstable Version](https://poser.pugx.org/baopham/dynamodb/v/unstable)](https://packagist.org/packages/baopham/dynamodb)
[![Build Status](https://travis-ci.org/baopham/laravel-dynamodb.svg?branch=master)](https://travis-ci.org/baopham/laravel-dynamodb)
[![Code Coverage](https://scrutinizer-ci.com/g/baopham/laravel-dynamodb/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/baopham/laravel-dynamodb/?branch=master)
[![License](https://poser.pugx.org/baopham/dynamodb/license)](https://packagist.org/packages/baopham/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 in v2: config no longer lives in config/services.php**

* [Install](#install)
* [Usage](#usage)
  * [find() and delete()](#find-and-delete) 
  * [Conditions](#conditions)
  * [all() and first()](#all-and-first)
  * [Pagination](#pagination)
  * [update](#update) / [updateAsync()](#updateasync)
  * [save](#save) / [saveAsync()](#saveasync)
  * [delete](#delete) / [deleteAsync()](#deleteasync)
  * [chunk](#chunk)
  * [limit() and take()](#limit-and-take)
  * [firstOrFail()](#firstorfail)
  * [findOrFail()](#findorfail)
  * [refresh()](#refresh)
  * [Query scope](#query-scope)
  * [REMOVE — Deleting Attributes From An Item](#remove--deleting-attributes-from-an-item)
  * [toSql() Style](#tosql-style)
  * [Decorate Query](#decorate-query)
* [Indexes](#indexes)
* [Composite Keys](#composite-keys)
* [Query Builder](#query-builder)
* [Requirements](#requirements)
* [Migrate from v1 to v2](#migrate-from-v1-to-v2)
* [FAQ](#faq)
* [License](LICENSE)
* [Author and Contributors](#author-and-contributors)

Install
------

* Composer install
    ```bash
    composer require baopham/dynamodb
    ```
 
* Install service provider:

    ```php
    // config/app.php

    'providers' => [
        ...
        BaoPham\DynamoDb\DynamoDbServiceProvider::class,
        ...
    ];
    ``` 
    
* Run

    ```php
    php artisan vendor:publish
    ``` 
    
* Update DynamoDb config in [config/dynamodb.php](config/dynamodb.php)

**For Lumen**

* Try [this](https://github.com/laravelista/lumen-vendor-publish) to install the `vendor:publish` command<commit_msg>Improve installation instructions<commit_after>laravel-dynamodb
================

[![Latest Stable Version](https://poser.pugx.org/baopham/dynamodb/v/stable)](https://packagist.org/packages/baopham/dynamodb)
[![Total Downloads](https://poser.pugx.org/baopham/dynamodb/downloads)](https://packagist.org/packages/baopham/dynamodb)
[![Latest Unstable Version](https://poser.pugx.org/baopham/dynamodb/v/unstable)](https://packagist.org/packages/baopham/dynamodb)
[![Build Status](https://travis-ci.org/baopham/laravel-dynamodb.svg?branch=master)](https://travis-ci.org/baopham/laravel-dynamodb)
[![Code Coverage](https://scrutinizer-ci.com/g/baopham/laravel-dynamodb/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/baopham/laravel-dynamodb/?branch=master)
[![License](https://poser.pugx.org/baopham/dynamodb/license)](https://packagist.org/packages/baopham/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 in v2: config no longer lives in config/services.php**

* [Install](#install)
* [Usage](#usage)
  * [find() and delete()](#find-and-delete) 
  * [Conditions](#conditions)
  * [all() and first()](#all-and-first)
  * [Pagination](#pagination)
  * [update](#update) / [updateAsync()](#updateasync)
  * [save](#save) / [saveAsync()](#saveasync)
  * [delete](#delete) / [deleteAsync()](#deleteasync)
  * [chunk](#chunk)
  * [limit() and take()](#limit-and-take)
  * [firstOrFail()](#firstorfail)
  * [findOrFail()](#findorfail)
  * [refresh()](#refresh)
  * [Query scope](#query-scope)
  * [REMOVE — Deleting Attributes From An Item](#remove--deleting-attributes-from-an-item)
  * [toSql() Style](#tosql-style)
  * [Decorate Query](#decorate-query)
* [Indexes](#indexes)
* [Composite Keys](#composite-keys)
* [Query Builder](#query-builder)
* [Requirements](#requirements)
* [Migrate from v1 to v2](#migrate-from-v1-to-v2)
* [FAQ](#faq)
* [License](LICENSE)
* [Author and Contributors](#author-and-contributors)

Install
------

* Composer install
    ```bash
    composer require baopham/dynamodb
    ```
 
* Install service provider (< Laravel 5.5):

    ```php
    // config/app.php

    'providers' => [
        ...
        BaoPham\DynamoDb\DynamoDbServiceProvider::class,
        ...
    ];
    ``` 
    
* Run

    ```php
    php artisan vendor:publish --provider 'BaoPham\DynamoDb\DynamoDbServiceProvider'
    ``` 
    
* Update DynamoDb config in [config/dynamodb.php](config/dynamodb.php)

**For Lumen**

* Try [this](https://github.com/laravelista/lumen-vendor-publish) to install the `vendor:publish` command
{'fraction_non_alphanumeric': 0.18850317282568121, 'fraction_numerical': 0.0022396416573348264, 'mean_word_length': 4.635120925341745, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 7, 'https://': 26, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3559099', 'n_tokens_mistral': 2007, 'n_tokens_neox': 1877, 'n_words': 291}