Answers for "Eloquent\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 "Eloquent\Collection to array"

Browse Popular Code Answers by Language