Photo: Dan Jones
Heat the oil in a large deep saucepan or casserole dish (with a lid). Gently cook the onion and fennel, covered, for 10-15 minutes or until soft. Add the garlic and cook, stirring, for 2 minutes, then transfer the onion mixture to a large bowl. Leave to cool.
Preheat the oven to 190°C / fan 170°C / gas 5. Return the pan to the heat, add 1 of the bags of mixed leaves and 1 tablespoon water, cover with a lid and cook for 1-2 minutes, stirring once, until wilted. Transfer to a colander and leave in the sink while you repeat with the remaining bag of mixed leaves and the bag of spinach. Squeeze all the leaves in the colander to remove as much water as possible. Transfer to a board and roughly chop.
Add the ricotta, goats’ cheese and plenty of freshly grated nutmeg to the bowl with the onion. Add the chopped leaves and combine well. Season well to taste, then mix in the beaten eggs.
Lightly grease a 20cm round, 7cm-deep springform cake tin. Remove the filo pastry from its packaging and cover with a damp tea towel (keeping it covered as you work). Take a sheet at a time, brush all over with melted butter then lay in the tin, so it covers the base and overhangs the sides. Take another sheet, brush with butter and lay on top, overlapping the sheet already in place, repeat with 3 of the remaining sheets until the tin is lined – you should have one sheet left over.
Spoon the filling into the tin and level. Fold the overhanging filo into the middle. Finally top with the remaining sheet, gently scrunching it to create folds, brush with the remaining butter. Transfer to a baking tray.
Bake in the oven for 35-40 minutes until the pastry is golden and crisp. Allow to stand for 10 minutes before removing from the tin, transfer to a board and slice into wedges. Serve warm with a lightly dressed seasonal salad leaves – it’s also tasty cold.
Get ahead: make up to a day ahead; chill. To reheat, bake in a preheated oven for 15-20 minutes until warmed through.