Answers for "convert an array to a collection laravel"

PHP
4

laravel collection toArray

$collection = collect(['name' => 'Desk', 'price' => 200]);

$collection->toArray();

/*
    [
        ['name' => 'Desk', 'price' => 200],
    ]
*/
Posted by: Guest on July-24-2021

Code answers related to "convert an array to a collection laravel"

Browse Popular Code Answers by Language