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.