Very nice collections methods a good Laravel programmer must be aware off. This is where collections shine over the use of plain arrays. Although when possible I like to filter and transform as much as possible in the Eloquent query itself of maximum performance.
One little suggestions on the 7th method: Partition. I would always use longer and self-describing variable names like $managers and $programmers in this example.
Very nice collections methods a good Laravel programmer must be aware off. This is where collections shine over the use of plain arrays. Although when possible I like to filter and transform as much as possible in the Eloquent query itself of maximum performance.
One little suggestions on the 7th method: Partition. I would always use longer and self-describing variable names like $managers and $programmers in this example.
Thanks for the article!
Thanks a lot for your feedback!
That's certainly a valuable tip. 👍
Definitively true. I just wanted to keep it short for better readability on smaller screens.