Skip to content

[5.5] Document Collection::make() method #3701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ As mentioned above, the `collect` helper returns a new `Illuminate\Support\Colle

$collection = collect([1, 2, 3]);

Of course, you may also use the `Collection` class constructor or even the static `make()` method:

$collection = new Collection([1, 2, 3]);

$collection = Collection::make([1, 2, 3]);

> {tip} The results of [Eloquent](/docs/{{version}}/eloquent) queries are always returned as `Collection` instances.

<a name="available-methods"></a>
Expand Down Expand Up @@ -80,6 +86,7 @@ For the remainder of this documentation, we'll discuss each method available on
[keyBy](#method-keyby)
[keys](#method-keys)
[last](#method-last)
[make](#method-make)
[map](#method-map)
[mapWithKeys](#method-mapwithkeys)
[max](#method-max)
Expand Down Expand Up @@ -739,6 +746,11 @@ You may also call the `last` method with no arguments to get the last element in

// 4

<a name="method-make"></a>
#### `make()` {#collection-method}

The static `make` method creates a new collection instance. See the [Creating Collections](#creating-collections) section.

<a name="method-map"></a>
#### `map()` {#collection-method}

Expand Down