laravel convert db::table select first to array code example
Example: laravel get query result as array
$result = array_map(function ($value) {
return (array)$value;
}, $result);
$result = array_map(function ($value) {
return (array)$value;
}, $result);