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

Using factories by morph name #71

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Prashank25
Copy link

Hello,

this is the PR for issue #50, I got no response on the issue so I figured I might as well try a PR directly.

This PR adds support for using factories by Eloquent model morph name.

cy.create('App\\Models\\User', { email: 'test@example.com' });

can be a little more simplified and more straightforward to type

cy.create('user', { email: 'test@example.com' });

cy.create({
    model: 'user',
    attributes: { email: 'test@example.com' },
    count: 10
})

Feel free to close it if it's not something you want in the package.

Thank you!

Signed-off-by: Prashank Abhishek <prashank@codesm.com>
Signed-off-by: Prashank Abhishek <prashank@codesm.com>
Signed-off-by: Prashank Abhishek <prashank@codesm.com>
@grantholle
Copy link

I was going to contribute the same thing!

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

Successfully merging this pull request may close these issues.

2 participants