array in laravel query code example
Example 1: laravel query builder get data as array of array
$array = json_decode(json_encode($result), true);
Example 2: laravel get query result as array
$result = array_map(function ($value) {
return (array)$value;
}, $result);