Heat oven to 180C/160C fan/gas 4. Put the lentils, onions, garlic, herbs and spices in a large pan, and pour in 850ml water. Bring to the boil, cover and simmer for 10 mins.
Tip in the tomatoes, stock cube, sweet potato and aubergine, then cover and simmer for a further 20-25 mins until the lentils and veg are tender, and the liquid has been absorbed. Remove the bay leaves.
Meanwhile, beat the fromage frais, egg and cheese together. Tip the lentil mixture into a large ovenproof dish, cover with the cheese mixture, then arrange the tomatoes on top. Grind over some black pepper and bake for 25 mins until the topping is set. Will keep for 3 days in the fridge.