Preheat oven to 375°F. Unroll puff pastry and place on a baking sheet lined with parchment paper. Dock all over the top with a fork. Whisk 1 egg with the milk and brush the puff pastry liberally. Bake until puffed up and golden brown, about 20 minutes. Remove from the oven (but leave it on) and allow to cool.
Set a large skillet over medium-high heat with the olive oil. Once hot, add in the sliced courgette, shallot, garlic, thyme, and a big pinch of salt and pepper. Cook for 20 minutes, until the courgettes and onions have become soft and slightly caramelized. Remove from the heat and allow to cool slightly.
In a bowl, mix the ricotta with half of the parmesan, the torn basil and the remaining egg. Season with salt and pepper and mix well to combine.
Gently push down on the risen puff pastry to form an even base. Spread with the ricotta mixture, leaving a 1-inch border along the edges. Top with the courgette and shallot mixture and then sprinkle over the remaining parmesan. Bake until golden brown, about 25 to 30 minutes. Allow to cool for 10 minutes.
To make the crisp, herby salad, toss everything together in a large bowl and season well with salt and pepper. Slice the torte and serve with the salad on top. Enjoy!
Notes
Adapted from Theo Randall's "The Italian Deli Cookbook"