By John Koster
The make
static method creates a new instance of a collection with the provided $items
(assuming that the provided $items
argument is not already a collection instance).
#Signature
1public static function make(
2 $items = []
3);
#Example Use
The following code sample highlights the usage of the make
static method:
1use Illuminate\Support\Collection;
2
3$items = [
4 'sea' => 'Mosasaurus',
5 'air' => 'Argentavis magnificens',
6 'land' => 'Dusicyon australis'
7];
8
9$collection = Collection::make($items);
10
11// true
12$isCollection = $collection instanceof Collection;
∎