Laravel Collections or Foreach? Shorter? More Readable?
I want to raise a discussion. Laravel Collections allow you to avoid writing loops, also chaining the methods to make the code shorter. But is it really better or more readable? Let’s discuss this.
Resources mentioned:
- My original tweet:
- Adam Wathan’s book “Refactoring to Collections“:
- Christoph Rumpel “How I refactor to collections“:
33 views
259
47
4 months ago 00:43:41 2
Знакомство с Yii: история фреймворка, отличия от Laravel и Symfony, архитектура
5 months ago 00:12:17 1
Getting Started with LaraChain (LaraLamma)
5 months ago 00:40:21 1
Laravel 10. Работа с БД. Коллекции. Eloquent ORM vs Database
5 months ago 00:04:31 3
Laravel Collections: filter, map, flatten - Practical Example
6 months ago 00:04:34 2
Laravel Collections: map(), reverse(), values() - Chain Example