mehedimi/laravel-dynamodb

A package for Laravel to communicate DynamoDB

0.3.0 2021-09-11 09:15 UTC

This package is auto-updated.

Last update: 2024-11-11 16:06:06 UTC


README

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