Laravel with Dynamodb

Wal*_*ase 0 php controller model amazon-web-services laravel

我创建了一个User模型和UserController

和我的模型 User.php是

<?php    
namespace App;    
use Illuminate\Notifications\Notifiable;
use Aws\DynamoDb\DynamoDbClient;

class User extends \Aws\DynamoDb\DynamoDbClient
{
    protected $table = 'users';
    protected $fillable = array('email');
    protected $primaryKey = 'user_id';
}
Run Code Online (Sandbox Code Playgroud)

当我在UserController中创建一个对象时

public function postSignUp(Request $request)
    {    
        $user = new User();
Run Code Online (Sandbox Code Playgroud)

它说$ user = new User();(line30)错误

传递给Aws\AwsClient :: __ construct()的参数1必须是类型数组,没有给定,在第30行调用C:....\laravel\app\Http\Controllers\UserController.php并定义

谢谢!!

the*_*sin 5

您不能只是继续替换您的用户Eloquent模型以扩展DynamoDbClient并期望一切正常.DynamoDbClient是一个完整的客户端来处理您的数据库需求,甚至不是一个可以扩展的模型...

只需使用为此确切原因设计的Laravel包.

这是我刚发现的一个:https://github.com/baopham/laravel-dynamodb