cypress icon indicating copy to clipboard operation
cypress copied to clipboard

Using factories by morph name

Open prashank25 opened this issue 3 years ago • 1 comments
trafficstars

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: '[email protected]' });

can be a little more simplified and more straightforward to type

cy.create('user', { email: '[email protected]' });

cy.create({
    model: 'user',
    attributes: { email: '[email protected]' },
    count: 10
})

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

Thank you!

prashank25 avatar Sep 30 '22 11:09 prashank25

I was going to contribute the same thing!

grantholle avatar Oct 09 '22 03:10 grantholle