Search

An Introduction to Laravel's Collection Public API

November 29, 2016 —John Koster

The Collection class exposes a generous public API, consisting of, at the time of this writing, 64 public methods. The Collection API exposes methods for retrieving values from a collection, transforming the underlying array, pagination and simple aggregate functions, amongst others. This section will cover most of the methods in the public API, excluding those methods required to implement PHP's ArrayAccess and IteratorAggregateinterfaces, as well as the getCachingIterator method.

Some absolutely amazing
people

The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.