Published on April 22, 2018
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;
∎
John Koster
Learning text parsing, manipulation, encoding and more through the Laravel string helpers.
Published on April 11, 2018
Published on November 29, 2016
Published on November 21, 2016