easyframework/collections
A fluent, framework-agnostic PHP collections library from easyframework. Chain map, filter, reduce, group, sort, and other operations over arrays and iterables through an expressive, readable API. Immutable, lazy-friendly, dependency-free, and easy to drop into any PHP or Laravel project.
Illuminate\Support\Collection stay at the edges instead of leaking into entities and use cases.Consider the pattern (not necessarily the dependency) when:
Look elsewhere — or write it in-house — when:
each(), count() on non-Countable, and missing return types), and it will not receive PHP 8.x compatibility work or security patches. Zero dependents means zero community pressure to fix anything.Illuminate\Support\Collection is maintained, documented, and already in the dependency graph; adding a second collection abstraction costs cognitive overhead for no portability benefit you'll actually exercise.doctrine/collections is actively maintained and battle-tested for the same role.ramsey/collection or loophp/collection cover the space with PHP 8 support and security responsiveness.src/Domain/Collection/CollectionInterface.php plus one Laravel adapter is a 1–2 day task with no supply-chain risk. Prefer that path in almost every case.Adoption rule of thumb: treat this package as a reference implementation to read, not a composer dependency to install.
For executives (one paragraph): This is a small, free, MIT-licensed PHP library that defines a standard "collection" interface so business logic doesn't get welded to a specific framework. It's a useful design reference but it was archived in 2017 and has no active users or maintainers, so I do not recommend adopting it as a dependency — that would create an unpatched, unsupported component in our stack. Instead I recommend we spend roughly one to two engineering days writing a short internal interface inspired by it, which gives us the same portability benefit with zero long-term maintenance or security exposure. Net recommendation: reject as a dependency, harvest the pattern.
For engineering leads: The package is an archived 2017 collection abstraction with PHP 7-era code, no PHP 8 support, and no dependents. Don't composer require it. Do read it — its interface/adapter split is a clean model for keeping Illuminate\Support\Collection out of domain code. Proposed action: one spike to draft our own CollectionInterface + LaravelCollectionAdapter, validated against two real bounded contexts, and a note in the architecture decision record that easyframework/collections was evaluated and declined on maintenance grounds.
For product/roadmap framing: The investment is measured in days, not sprints, and it buys optionality — the ability to move or extract a service later without a collection-layer rewrite. It is not a feature, so it shouldn't compete with roadmap items; it should ride alongside the next domain-layer refactor as low-cost hygiene.
How can I help you explore Laravel packages today?