01 -
Preheat the oven to 400°F (200°C).
02 -
Warm the olive oil in a large pot over medium-high heat. Add the shallots and leeks, cooking until softened, about 5 minutes.
03 -
Add ½ cup of wine to the shallot-leek mixture. Cook for 5 minutes, allowing the wine to reduce. Add the remaining ½ cup of wine and continue cooking until the mixture begins to caramelize.
04 -
Incorporate the garlic, mushrooms, thyme, chili flakes, salt, and pepper. Cook for an additional 3-4 minutes until mushrooms begin to soften.
05 -
Add the broth, bay leaf, and pasta to the pot. Bring to a boil, stirring regularly until the pasta is al dente and most of the broth has been absorbed, approximately 10 minutes.
06 -
Stir in the cream cheese and half of the gruyere cheese until well combined.
07 -
Transfer the pasta mixture to a baking dish. Top with the remaining gruyere cheese. Place in the middle rack of the oven and bake for 20 minutes until the cheese has melted and is lightly browned.
08 -
Garnish with fresh thyme leaves before serving.