Rename $count
to $chunkSize
in each()
/eachById()
for clarity on chunking behavior
#52879
Unanswered
Jehong-Ahn
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The
each()
internally uses thechunk()
. However, the variable name$count
used as an argument ineach()
can be misleading to users unfamiliar with the internals of Eloquent. Many may incorrectly assume that$count
refers to the iteration count, when in fact it controls the chunk size.To improve clarity, I propose renaming the
$count
variable to$chunkSize
. This change would make it clear that the argument defines the size of the chunk used internally bychunk()
, reducing potential confusion.I am attaching a tweet from a user who has also misunderstood the
$count
parameter in theeach()
method.Beta Was this translation helpful? Give feedback.
All reactions