Choose a new cookbook worth up to £28 when you subscribe to our magazine.
To make the pastry, tip both the flours, a pinch of salt and the cayenne, if using, into a large bowl. Mix, then rub in the butter using your fingertips until the mixture is crumbly. Mix in the egg and 1 tbsp cold water using a cutlery knife. Bring the pastry together into a ball, then cover and chill for 30 mins. Knead briefly until pliable, then roll out until it’s large enough to line a 20cm deep pie dish. Line the dish, pushing the pastry into the edge, then trim. Chill until needed.
Meanwhile, for the filling, heat the butter in a large saucepan until sizzling and cook the onions with some seasoning and the leeks and thyme, if using, for 12-15 mins until soft and sticky. Stir the potatoes into the onion mix, then reduce the heat, cover and cook for 10-15 mins, stirring occasionally, until the potatoes break down when pressed with a wooden spoon. Pour over the cream, stir for a minute, then turn off the heat and leave to cool a little.
Heat the oven to 200C/180C fan/gas 6 with a baking tray inside. Stir half the cheddar and most of the spring onions through the potato and onion mix. Scatter half of the remaining cheddar over the base of the pastry case, then tip in the tip filling. Scatter with the rest of the cheese and spring onions. Bake on the hot baking tray for 40-45 mins until the pastry is deeply golden and the filling is bubbling. Remove from the oven and leave to rest for at least 10 mins. Serve hot, or leave to cool until just warm.