This generates, persists, and returns a collection of items:
Factory::times(42)->create(...);
Whereas this generates and returns only one item, ignoring the times() call:
Factory::times(42)->build(...);
For consistency and least astonishment, Factory::build should take times() into account. I can't think of any API/BC break, can you?
About implementation, beware: create iteratively calls persist, which in turn calls build, don't loop in another loop!
This generates, persists, and returns a collection of items:
Whereas this generates and returns only one item, ignoring the
times()call:For consistency and least astonishment,
Factory::buildshould taketimes()into account. I can't think of any API/BC break, can you?About implementation, beware:
createiteratively callspersist, which in turn callsbuild, don't loop in another loop!