Answers for "how to convert an array to a collection in 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 "how to convert an array to a collection in laravel"

Browse Popular Code Answers by Language