Finely slice the shallot, crush or grate the garlic, and slice the courgettes into rounds roughly the thickness of a £1 coin. Pick the leaves from the thyme.
Sweat the shallots gently in a pan with the thyme and the olive oil until soft - about 5 minutes. Add the garlic and cook for a further 30 seconds - then drain through a sieve, reserving the oil.
Roll out the pastry to a thickness of half a centimeter. Use the tip of a sharp knife to score a 2cm border all around the edge. Brush the border with beaten egg. Beat the cream cheese with a couple of tablespoons of water to soften it a bit, then spread all over the base of the tart, up to (but not over) the border. Spread the shallots and garlic over the top. Toss the courgette slices with the reserved olive oil, season with salt and pepper and arrange over the tart. Top with Parmesan and bake in a 200c oven for about 30 minutes - it should have a lovely golden brown pastry and a bubbling top. Remove from the oven, scatter over some roughly torn basil and serve with a nice salad.
«This tart will be best with homemade rough puff pastry - but you could use ready rolled puff pastry for a simpler version.»