Level 29
Generate the fake data by using the Factory Relationships
Example:
Customer::factory()->count(10)->hasSalesOrders(3)->create();
1 like
Summer Sale! All accounts are 50% off this week.
Hello,
So I'm trying to run this
$order = SalesOrder::factory()->create();
But when I run it I get the message that testing.customers does doesn't exist. If there is joined tables, how do I run the factory to get all of the factory to load the testing data? Do I do it in sequence? (I hope not)
$customer = Customer::factory()->create();
$order = SalesOrder::factory()->create();
Which brings up more errors because now customers now needs testing.customer_groups.
Thank You.
Please or to participate in this conversation.