Option to create multiple instances of a data object by specifying the count (e.g., 2) #802
danielh-official
started this conversation in
Ideas
Replies: 1 comment
-
That would technically not be possible since it would violate the Arrayable interface. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This can be an optional argument in the
toArray
andall
functions.Just like how Laravel Factories have a "count" option that can be specified in the
factory
method (e.g.,Model::factory(10)->create()
will create 10 models).Essentially, when creating data objects, I would set the default values to faker variables to imitate the factory structure and then set the resulting object to array.
Current Setup
Proposed Setup
Beta Was this translation helpful? Give feedback.
All reactions