In a pan put the margarine, the crushed garlic and the onion cut into cubes, to brown.
Add the wheat flour and mix well and then slowly pour the milk into the pan, stirring all the time.
Add salt and pepper and mix well. Let it boil. Then add the cream, mix well and turn off the heat.
Put a little white sauce in a refractory, then place a layer of sliced bread, a layer of ham and another layer of mozzarella, until you reach the top of the refractory.
Finally put the mozzarella and take it to gratin for 15 minutes.