01 - Preheat the oven to 375°F. Prepare four individual ramekins or a medium baking dish by greasing lightly with butter or cooking spray.
02 - In a saucepan, melt butter over medium heat. Whisk in flour and cook for 1 minute to create a roux. Slowly add milk, whisking constantly until the sauce thickens. Stir in Gruyère cheese, a pinch of nutmeg, salt, and pepper. Remove from heat once smooth and creamy.
03 - Briefly sauté spinach in a skillet over medium heat until wilted, about 2-3 minutes. Remove and drain any excess liquid.
04 - Place a slice of puff pastry or toasted brioche in the bottom of each ramekin. Layer with sautéed spinach, zucchini slices, tomato, and ham (or mushrooms for vegetarian option). Repeat for all ramekins.
05 - Spoon the prepared cheese sauce evenly over the layered vegetables and ham in each ramekin, ensuring all ingredients are lightly coated.
06 - Make a shallow well in the center of each ramekin and carefully crack an egg on top of the sauce and vegetable layers. Season eggs lightly with salt and pepper.
07 - Bake for 20-25 minutes at 375°F until eggs are just set but yolks remain runny. Adjust baking time by 2-3 minutes longer if you prefer firmer yolks.
08 - Remove from oven and let rest for 2 minutes. Garnish with fresh chives or parsley before serving hot.