Preheat the oven to 200°C and line a large baking tray with greaseproof paper.
Fry the onion and garlic in oil for 3 minutes until soft then cool in a bowl.
Mix beef, herbs, tomato purée, flour, salt, and pepper into the onion mixture by hand.
Roll the puff pastry into a 34cm square on a lightly floured surface.
Spread the meat mixture over the pastry, leaving a 2cm border.
Sprinkle with cheese if using and brush the edges with beaten egg.
Roll the pastry up firmly into a log shape.
Cut the roll into 12 even slices using a serrated knife.
Place slices on the tray, flatten slightly, and brush tops with egg glaze.
Bake for 15 minutes until golden brown and the beef is cooked through.