I want to insert some data into sub in json data with foreach

example :

* each house have one or more rooms
* rooms data in sub house

this the code:

```
<?php

$houses = Houses::find()->all();
foreach($houses AS $house){
    $a[] = [
        'house_name' => $house->name,
         'color_wall' => $house->color_wall,
    ];

    $rooms = Rooms::find()->where(['house_id' => $house->id])->all();
    foreach($rooms AS $room){
        $b[] = [
            'room_name' => $room->name,
            'color_wall' => $room->color_wall,
        ];
    }
    array_push($a,$b);
}

```

I want the array to look like this:

```
[
    {
        'house_name' : 'house 1',
        'color_wall' : 'white',
        'room' : [
            {
                'room_name' : 'guest room',
                'color_wall' : 'blue',  
            },
            {
                'room_name' : 'primary room',
                'color_wall' : 'green', 
            }
        ]
    }
]

```

But I can't input rooms into the sub-arrays.

```
[
    {
        'house_name' : 'house 1',
        'color_wall' : 'white',
    }
    {
        'room_name' : 'guest room',
        'color_wall' : 'blue',  
    },
    {
        'room_name' : 'primary room',
        'color_wall' : 'green', 
    }
]

```