Grease the baking tray with butter or oil.
In a frying pan, on medium heat, add a spoonful of olive oil, when it gets hot, add the sliced red onion and the mushrooms.
Cook, stirring, until the mushrooms and onions brown and become soft.
Add the spinach leaves and continue cooking for another minute.
Turn off the heat and cover with a lid, let the mixture cool.
In a large bowl, mix eggs, milk, mustard, thyme, salt, pepper and nutmeg.
After the egg mixture is homogeneous, add the cubed bread, the grated Gruyere and the mushroom mixture.
Mix the ingredients together and pour the mixture into the baking tray.
Sprinkle with grated Parmesan.
Cover the tray and put it in the fridge for at least 30 minutes or overnight.
Bake in the hot oven (180C/375F) for 45 minutes or until browned on the edges.
Serve warm with fresh chopped herbs.