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
325
56
2 months ago 00:10:02 4
We Love PHP Attributes
3 months ago 01:14:53 1
398: Cats, Coffee, and PHP
3 months ago 10:44:08 2
PHP For Beginners - Complete Course (2023) [Check Comment for HD version Link]
3 months ago 00:04:09 1
Timezones List Dropdown: Grouped with Laravel Collections
3 months ago 00:45:17 2
Adam Wathan on “Designing a Component Library“ | Laracon US 2024 in Dallas, TX
3 months ago 00:08:20 4
Complex Seeder: Eloquent Optimization Example
4 months ago 01:17:09 1
394: ELIE, Explain It Like I’m Eric
4 months ago 00:54:31 9
Generics in PHP???
5 months ago 00:04:00 2
Laravel tip: Higher order collection proxies (and Zevia)
6 months ago 00:01:40 1
LaraLlama Training - What is a Collection
6 months ago 01:17:19 1
Ep-7: Model & Collection Support - Laravel Carousel Package 📦
6 months ago 00:09:08 1
LaraLlama Training - Chatting with your Collection
6 months ago 00:03:20 1
LaraLlama Training - Our First Collection
6 months ago 00:01:39 4
Laravel collections now include a “multiply“ method
6 months ago 00:02:37 1
Collection Before And After Methods & Artisan Commands Update
6 months ago 00:01:49 1
Laravel Collections now have before and after methods
7 months ago 00:43:41 4
Знакомство с Yii: история фреймворка, отличия от Laravel и Symfony, архитектура
8 months ago 00:12:17 1
Getting Started with LaraChain (LaraLamma)
9 months ago 00:40:21 1
Laravel 10. Работа с БД. Коллекции. Eloquent ORM vs Database
9 months ago 00:04:31 3
Laravel Collections: filter, map, flatten - Practical Example
9 months ago 00:04:34 2
Laravel Collections: map(), reverse(), values() - Chain Example