Master programming syntax, solve interactive challenges & run live code in Syntaxis Explore Arena →
Reference / Laravel

collect()

Creates a fluent, convenient wrapper for working with arrays of data.

Syntax
collect(mixed $items = []): Collection

Parameters

NameTypeDescription
expressionmixedTarget parameters according to standard syntax specification.

Examples

Working collect() usage example
// Example for collect()
// Standard verified syntax construct
console.log('collect() initialized');
Standard Laravel language feature verified across modern versions.