01 - Preheat oven to 400°F. Lightly grease a 9-inch pie dish or tart pan.
02 - Heat olive oil over medium heat in a large skillet. Cook chopped onion until soft, approximately 5 minutes. Add garlic and cook for an additional minute.
03 - In batches, add fresh spinach to the skillet and cook until wilted; if using frozen, add and cook until heated through. Drain in a colander, pressing out excess moisture. Roughly chop as needed and allow to cool slightly.
04 - In a mixing bowl, thoroughly combine the cooked spinach, feta, ricotta, eggs, Parmesan, dill, nutmeg, salt, and black pepper.
05 - Roll out puff pastry to fit the pie dish with some overhang. Press pastry into the dish and trim excess edges.
06 - Evenly spread the spinach-cheese mixture over the pastry base. Fold any overhanging pastry inward to form a rustic edge.
07 - Brush the exposed pastry edges with the beaten egg to achieve a golden finish during baking.
08 - Bake for 35 to 40 minutes, until the filling is set and pastry turns golden brown.
09 - Allow to cool for 10 minutes before slicing and serving.