laravel query builder return array code example
Example 1: laravel query builder get data as array of array
$array = get_object_vars($result);
Example 2: laravel query builder get data as array of array
$array = json_decode(json_encode($result), true);
Example 3: return query builder result to array
$result = DB::table('user')->where('name',=,'Jhon')->get();