01 - Preheat oven to 400°F. Lightly grease a 9-inch pie dish or tart pan.
02 - Heat olive oil in a large skillet over medium heat. Sauté the chopped onion until soft, about 5 minutes. Add minced garlic and cook for another minute.
03 - Add fresh spinach in batches, cooking until wilted. If using frozen spinach, add directly and heat through. Transfer spinach to a colander and press out excess moisture. Roughly chop if necessary. Let cool slightly.
04 - In a large mixing bowl, stir together the spinach, feta, ricotta, eggs, Parmesan, dill, nutmeg, salt, and pepper until evenly combined.
05 - Roll out the puff pastry to fit the pie dish, allowing for some overhang. Press the pastry into the dish and trim excess edges.
06 - Evenly spread the spinach and cheese filling over the pastry. Fold any overhanging pastry inward to create a rustic edge.
07 - Brush the exposed pastry edges with the beaten egg to achieve a golden finish upon baking.
08 - Bake for 35 to 40 minutes, until the filling is set and the crust is golden brown.
09 - Allow the dish to cool for 10 minutes before slicing and serving.