April 22, 2018 —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).
1public static function make(2 $items = []3);
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// true12$isCollection = $collection instanceof Collection;
∎
The following amazing people help support this site and my open source projects ♥️
If you're interesting in supporting my work and want to show up on this list, check out my GitHub Sponsors Profile.