Put the flour and butter in a food processor and pulse until they take on the texture of bread crumbs. (Or place in a mixing bowl and rub the butter into the flour with your fingertips). Once combined, add the egg and 1 tablespoon cold water and pulse until combined (or mix by hand).
Roll out the dough on a lightly floured, cold work surface to a circle large enough to line the tart tin and about 3mm thick, leaving a generous edge to allow for shrinking in the oven. Lay the pastry in the tin and push it gently into the corners where the base meets the sides. Prick the base and sides of the pastry and chill in the fridge for 15 minutes.
Preheat the oven to 180C/160C Fan/Gas 4.
Line the chilled pastry with baking paper and fill with baking beans and bake for 10 minutes. Remove the beans and paper and put the pastry case back in the oven for another 10-15 minutes. Remove from the oven and set aside to cool.
Increase the oven temperature to 200C/180C Fan/Gas 6.
Put the onions and courgettes in a large sandwich bag, drizzle with olive oil and season generously with salt and pepper and shake the bag to coat. Tip onto a large baking tray. Roast for 30-40 minutes, turning the vegetables over halfway through cooking, until tender and golden-brown. Remove from the oven. Reduce the oven temperature to 180C/160C/Gas 4.
Meanwhile, bring a small amount of water to the boil in a wide lidded pan. Once boiling add the spinach, clamp down the lid and turn off the heat. After 5 minutes, drain the spinach and leave to cool. Gather the spinach into a ball and using a clean tea towel squeeze as much water out as possible. Once the spinach is as dry as you can get place it on a chopping board and roughly chop. Whisk together the cream, eggs and half the cheese and season well with salt and pepper.
Once the vegetables are roasted you are ready to assemble the quiche. Sprinkle the remaining cheese onto the base of the pastry case. Pile in the vegetables, spreading them out so that they are evenly distributed, and pour over the cream mixture.
Bake the quiche for 25â€“35 minutes or until the filling is set and golden-brown on top. Take out of the oven and leave to cool slightly before removing from the tin and transferring to a serving plate. Serve warm.