Melt the butter in a large saucepan. Cook the onion and the garlic together slowly on low heat for at least 15 minutes. Don`t let them burn. They should be soft and nicely caramelized.
Add wine, beef stock, bay leaves, thyme to the onions. Bring to boil. Then reduce the heat and let it simmer for 20 minutes approximately.
Cut half of the baguette in big slices. Toast the bread on both sides.
Pour the soup into an oven safe bowl, place toasted baguette slices spread with grated cheese on top. Put the soup under the grill in the oven until the cheese melts and becomes golden. Serve very hot.
For a smoother taste substitute the beef stock for chicken stock.