Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factory Create - Bad connection name #111

Closed
macedd opened this issue Nov 28, 2017 · 3 comments
Closed

Factory Create - Bad connection name #111

macedd opened this issue Nov 28, 2017 · 3 comments

Comments

@macedd
Copy link

macedd commented Nov 28, 2017

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
Copy link
Owner

baopham commented Nov 29, 2017

Hm.... Ive never tested it with factory. So you can say, it is not yet supported. Can you not use factory for now?

@macedd
Copy link
Author

macedd commented Nov 29, 2017

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();

@macedd macedd closed this as completed Nov 29, 2017
@baopham
Copy link
Owner

baopham commented Nov 29, 2017

Nice. Will put this to FAQ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants