Answers for "laravel cast collection to array"

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 "laravel cast collection to array"

Browse Popular Code Answers by Language