To make the bechamel sauce, melt the butter over low heat in a medium-sized saucepan. Add the flour all at once to create a roux and stir with a wooden spoon until combined into a paste. Cook for 2 minutes, then remove from heat and set aside to cool.
Meanwhile, in another medium-sized saucepan, combine the milk, onion half, bay leaf, salt, pepper, nutmeg, and cayenne pepper. Slowly bring to a light boil, stirring occasionally. Once the milk is warm, strain half of it over the cold roux and whisk to fully blend with the roux before adding the rest of the milk. Return the saucepan to medium heat and continue stirring constantly until the sauce comes to a boil.
Once the sauce begins to bubble, let it cook for 2 minutes, stirring a little faster to prevent bits from sticking to the bottom. Taste and adjust the seasoning to your liking, then remove from heat. Add the cheese to the sauce and incorporate until melted.
Toast the bread slices and then coat each slice with butter. Spread a spoonful of bechamel sauce evenly over two slices of toast, followed by a layer of ham and then cheese.
For the croque monsieur, close the sandwich and spread a layer of bechamel sauce on top, followed by a sprinkle of cheese. For the croque madame, spread some bechamel sauce on the underside of the second slice of toast and then close the sandwich.
Place the sandwiches in the oven and bake for 15 minutes.
Meanwhile, fry an egg for the croque madame.
Remove the sandwiches from the oven and place the fried egg on top of the croque madame. Serve and enjoy.
