Turn the grill on.
Cut the aubergines into slices lengthways, spread them out on a plate and brush with olive oil using a knife.
Grill them for about 5 minutes, until they start to change colour.
Take them out and season them.
Pre-heat the oven to 180°C (th.6).
Chop the onions and garlic and cook in a pan with 2 tablespoons olive oil until they start to change colour. Add the herbs, salt and pepper and remove from the heat. Add the crumbled cheese so that it melts into the mixture.
Grease a gratin or baking dish and arrange layers of tomato, aubergine, onions and cheese. Finish with tomatoes and nice big slices of aubergine, add the beaten eggs mixed with flour, cream, milk, salt and pepper.
Bake for 35 minutes and enjoy hot or cold.