Skip to content

mehedimi/laravel-dynamodb

Repository files navigation

Laravel DynamoDB

Use aws dynamodb as a database on Laravel

Banner

Installation

composer require mehedimi/laravel-dynamodb

Configuration

Add dynamodb configs to config/database.php:

'connections' => [
    'dynamodb' => [
        'driver' => 'dynamodb',
        'region' => env('AWS_DEFAULT_REGION'),
        'access_key' => env('AWS_ACCESS_KEY_ID'),
        'secret_key' => env('AWS_SECRET_ACCESS_KEY'),
        'endpoint' => env('AWS_ENDPOINT'),
    ],
    ...
],

Use general raw PHP project

<?php
    $connection = new \Mehedi\LaravelDynamoDB\DynamoDBConnection([
        // Configuration goes here
    ]);
    
    $connection->table('Users')->query();

For more documentation click here