Preheat the oven to 200ºC/gas mark 6. Heat the oil in a large frying pan over a medium heat. Add the onion and cook for 5 minutes until softened, then add the garlic and herbs and cook for a further minute.
Add the mince and cook for a further 6-7 minutes until browned. Stir in the tomato purée, passata and pesto and simmer for 5 minutes.
Spoon a third of the beef mixture into a 20cm square ovenproof dish. Cover with 3 sheets of pasta and then a third of the white sauce. Repeat twice, finishing with the white sauce, then sprinkle over the grated cheese. Bake in the oven for 35-40 minutes, until golden brown and bubbling.