01 - Preheat the oven to 375°F. Lightly grease four individual ramekins or a medium baking dish with cooking spray or butter.
02 - Melt butter in a saucepan over medium heat. Whisk in flour and cook for 1 minute to form a roux. Gradually whisk in milk, stirring constantly until the sauce thickens. Remove from heat, then stir in Gruyère cheese, nutmeg, salt, and pepper until smooth and combined.
03 - Heat a skillet over medium-high heat. Add the chopped spinach and cook briefly, stirring constantly, until just wilted, about 1-2 minutes. Remove from heat.
04 - Place one slice of puff pastry or toasted brioche in the bottom of each ramekin. Layer the sautéed spinach, zucchini slices, tomato, and ham (or mushrooms for vegetarian version) on top of the bread base.
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 using the back of a spoon. Carefully crack one egg into each well. Season the eggs lightly with additional salt and pepper.
07 - Transfer the ramekins to the preheated oven. Bake for 20-25 minutes until the egg whites are completely set but the yolks remain slightly runny. Adjust baking time by 2-3 minutes longer if you prefer firmer yolks.
08 - Remove from the oven and let rest for 1-2 minutes. Sprinkle with fresh chopped chives or parsley before serving immediately.