01 - Preheat the oven to 375°F. Lightly grease four individual ramekins or one 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, stirring constantly. Gradually pour in milk while whisking continuously until sauce thickens. Remove from heat, stir in Gruyère cheese, nutmeg, salt, and pepper until smooth.
03 - Heat a skillet over medium-high heat. Add spinach and cook briefly until just wilted, approximately 2 minutes. Remove from heat and set aside.
04 - Place one 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).
05 - Spoon prepared cheese sauce evenly over each layered ramekin. Create a shallow well in the center of each and carefully crack an egg into each well. Lightly season eggs with salt and pepper.
06 - Bake for 20 to 25 minutes until eggs are just set with runny yolks and sauce is bubbly. Adjust baking time 2 to 3 minutes longer for firmer yolks if desired.
07 - Remove from oven and let rest for 2 minutes. Sprinkle with fresh chopped chives or parsley before serving hot.