01 - Preheat the oven to 375°F. Lightly grease four individual ramekins or a medium baking dish with butter or cooking spray.
02 - Melt butter in a saucepan over medium heat. Whisk in flour and cook for 1 minute to form a roux. Slowly pour in milk while whisking constantly until the sauce thickens. Stir in Gruyère cheese, nutmeg, salt, and pepper. Remove from heat once smooth and creamy.
03 - Heat a skillet over medium-high heat. Add spinach and sauté briefly until just wilted, about 1-2 minutes. Remove from heat and set aside.
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 version). Repeat for all ramekins.
05 - Spoon the prepared cheese sauce evenly over the layered vegetables and ham in each ramekin, ensuring all ingredients are well-coated.
06 - Create a shallow well in the center of each ramekin. Carefully crack one egg into each well. Season the eggs lightly with salt and pepper.
07 - Bake for 20-25 minutes until the egg whites are set but yolks remain runny. Adjust baking time by 2-3 minutes for firmer yolks if desired.
08 - Remove from oven and let rest for 2 minutes. Sprinkle with fresh chives or parsley before serving hot.