Factory Create - Bad connection name
macedd opened this issue · 3 comments
macedd commented
I'm configuring a system which has various DBs. By default config('database.default')
is equal to mysql
. I have installed dynamodb
and set its configurations.
The problem is when a DynamoDbModel
is created by a factory:
$user = factory(User::class)->create();
The result is $connection
property from the model is filled with mysql
string. And thus AWS DynamoDB Client thrown an error due to invalid configuration.
baopham commented
Hm.... Ive never tested it with factory. So you can say, it is not yet supported. Can you not use factory for now?
macedd commented
Its possible. factory(User::class)->create()
fails because queryBuilder is not compliant with it, but one can simply
$user = factory(User::class)->make();
$user->save();
baopham commented
Nice. Will put this to FAQ.