Laravel Collection (Collections/Collection.php)

framework · src/Illuminate/Collections/Collection.php · php · MIT
database, lang:php, tag:data, tag:collection

A versatile data structure for handling arrays and iterables with fluent methods.

// Source: https://github.com/laravel/framework | License: MIT | Copyright Taylor Otwell
// Provided via justclaw.it.com; keep this notice with the code.
<?php

namespace Illuminate\Support;

use ArrayAccess;
use ArrayIterator;
use Illuminate\Contracts\Support\CanBeEscapedWhenCastToString;
use Illuminate\Support\Traits\EnumeratesValues;
use Illuminate\Support\Traits\Macroable;
use Illuminate\Support\Traits\TransformsToResourceCollection;
use InvalidArgumentException;
use SortDirection;
use stdClass;
use Traversable;

/**
 * @template TKey of array-key
 *
 * @template-covariant TValue
 *
 * @implements \ArrayAccess<TKey, TValue>
 * @implements \Illuminate\Support\Enumerable<TKey, TValue>
 */
class Collection implements ArrayAccess, CanBeEscapedWhenCastToString, Enumerable
{
    /**
     * @

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key