Return to profile for Tim MacDonald

Eloquent collections: the extended edition

30 minute beginner seminar


Extending eloquent collections is a nice way to make your collections speak the projects domain language, but that is just the start to the benefits this pattern can produce. Extended eloquent collections can lead to codebase improvements including, but not limited to:

• Readability
• Extracting repeated logic
• Default and improved sorting methods
• Thinning models
• Encapsulation
• Sharing a filtering API with eloquent scopes
• Reducing database queries

In this talk I will step you through these one-by-one, painting a picture with code examples and discussion around each. Although each of these is a tiny, delicious morsel, they all come together to tell a bigger story, showing that small improvements can make a big impact.

Designed to be very practical with takeaways that developers can immediately implement in their own codebases.