Preheat the oven to 220°C/425°F/gas 7. Peel and chop the onion and place in a large non-stick pan on a medium heat with 1 tablespoon of olive oil. Peel, finely slice and add the garlic. Finely grate in the lemon zest, then cook for 10 minutes, or until softened, stirring regularly. Stir in the spinach, cover, and cook for 5 minutes, then remove the lid and cook for another 5 minutes, or until all the liquid has cooked away. Season to perfection. Unroll the pastry and place it, still on its paper, in a baking tray. Spread over the spinach, leaving a 5cm border all the way around. Sit the salmon fillets on top, 1cm apart, then use the paper to help you fold in the pastry edges to snugly encase the salmon, leaving it exposed on the top. Beat the eggs and use some to brush the exposed pastry, then bake at the bottom of the oven for 15 minutes.
Meanwhile, beat the pesto into the remaining egg. When the time’s up, pull out the tray and pour the egg mixture over the salmon and into the gaps. Return to the bottom of the oven for a final 15 minutes, or until the pastry is golden and the egg is just cooked through. Serve with lemon wedges, for squeezing over.