In a large heavy-based pan over low-to-medium heat, add olive oil, onions, garlic and a good pinch of salt. Stir regularly until onions are dark golden-brown and smell sweet and caramelised. If onions catch on the pan, add a splash of water to deglaze the pan.
Turn up heat a fraction and add wine, bay leaf and thyme. Reduce liquid by 50 percent before adding beef stock. Cook on low heat for around 30 minutes or until soup has thickened slightly.
Remove bay leaf and thyme, season with freshly ground black pepper and salt to taste.
Meanwhile, pre-heat oven to 180°C. Cut puff pastry to size. It should cover the top of each oven-proof soup bowl with 1–2cm overhang. Set aside.
Pour soup into deep bowls leaving around 4cm below rim and top with Gruyere.
Carefully place puff pastry over each bowl and use thumbs to firmly press down pastry edges to seal. Brush with egg yolk and bake in oven until golden brown and puffed.
