'Acme Corporation']); factory(User::class)->create([ 'account_id' => $account->id, 'first_name' => 'Jonathan', 'last_name' => 'Reinink', 'email' => 'jonathan@reinink.ca', 'owner' => true, ]); factory(User::class, 5)->create(['account_id' => $account->id]); $organizations = factory(Organization::class, 100) ->create(['account_id' => $account->id]); factory(Contact::class, 100) ->create(['account_id' => $account->id]) ->each(function ($contact) use ($organizations) { $contact->update(['organization_id' => $organizations->random()->id]); }); } }