Melt the butter in a large lidded frying pan, add the onions and bay leaf, season with salt and pepper; cover the onions closely with a piece of buttered greaseproof paper then put the lid on the frying pan; cook the onions over a low heat for about 30 minutes until they are soft and golden (shake the pan occasionally to make sure they don’t stick).
Roll the pastry to 1/4 inch thick on a lightly floured surface and use it to line an 8-9 inch diameter flan dish.
Beat the eggs lightly in a large bowl and season with salt, pepper and nutmeg; stir the cream and milk into the beaten egg mixture.
Drain the coked onions in a colander, remove the bay leaf and spread the onions over the pastry case; strain the egg mixture through a sieve over the onions.
Bake the flan in the centre of an oven pre-heated to 400ºF / 200ºC / gas mark 6 for 35 – 40 minutes: when cooked the pastry should be golden and the filling set; the filling will sink slightly as the flan cools.