Just so you know in case you don't but I guess you do. This is a "shorter" equivalent:
```php
$favDishesId = [];
foreach ($dishes as $dish){
   $favDishesId[] = $dish->dish_id;
}
```