admin管理员组

文章数量:1332345

I created a laravel 10 project with a version of logging through the 'php artisan ui react' command. However, now I need to configure it with dynamoDB and I get this error 'Undefined array key “database”'.

I have set up env. AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION= AWS_DYNAMODB_TABLE=users.

config/database.php I also set the ' '

'connections' => [
    'dynamodb' => [
        'driver' => 'dynamodb',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
    ]
] 

I created a laravel 10 project with a version of logging through the 'php artisan ui react' command. However, now I need to configure it with dynamoDB and I get this error 'Undefined array key “database”'.

I have set up env. AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION= AWS_DYNAMODB_TABLE=users.

config/database.php I also set the ' '

'connections' => [
    'dynamodb' => [
        'driver' => 'dynamodb',
        'key' => env('AWS_ACCESS_KEY_ID'),
        'secret' => env('AWS_SECRET_ACCESS_KEY'),
        'region' => env('AWS_DEFAULT_REGION'),
    ]
] 
Share Improve this question edited Nov 20, 2024 at 22:46 Martin Zeitler 76.9k20 gold badges165 silver badges237 bronze badges asked Nov 20, 2024 at 22:39 Szymon MastalerzSzymon Mastalerz 1
Add a comment  | 

1 Answer 1

Reset to default 0

How about giving it, what it demands?

'dynamodb' => [
    'driver'   => 'dynamodb',
    'key'      => env('AWS_ACCESS_KEY_ID'),
    'secret'   => env('AWS_SECRET_ACCESS_KEY'),
    'region'   => env('AWS_DEFAULT_REGION'),
    'database' => 'insert name here'
]

Else the server won't know which database shall be connected.

本文标签: amazon web servicesproblem with conect laravel 10 and dynamoDBStack Overflow