Closed RileyDavidson closed 4 years ago
Hi @RileyDavidson!
Thanks for creating this issue! Really appreciate it. I've just released a patch update (2.3.1-beta) that sorts this issue.
The syntax for this would be as follows:
$user = UserFactory::new()
->withCustomers(CustomerFactory::times(15)->state('first_time_customer'))
->withCustomers(CustomerFactory::times(15)->state('returning_customer'))
->create();
you've missed one )
in the end of the first with
method ;)
you've missed one
)
in the end of the firstwith
method ;)
Hey I created this thing, doesn't mean I know how to use it! 😂
It was super fast. Like 2 hours from the issue was created 👍
Move fast, break nothing
Wow! Yeah that was super fast, I appreciate it.
I'll get the latest version and test it out!
Hi.
I want to generate different factory states inside my With() statements.
Example
$user = UserFactory::new()
Essentially I want to generate 15 'returning customers' and 15 'first time customers'.
I realise this syntax most likely isn't correct (as I couldn't get it to work) but in the readme I can't figure out the correct way to accomplish this. I only see the way to apply multiple states to the same record.
Sorry if I'm just missing something simple!