Melt the stick of butter in a pot over medium heat.
Add the onions, garlic, bay leaves, thyme, and salt and pepper and cook until the onions are very soft and caramelized, stirring constantly, about 25 minutes.
Add the wine, bring to a boil, reduce the heat and simmer until the wine has evaporated and the onions are dry, about 5 minutes.
Remove the bay leaves and thyme sprigs.
Sprinkle the flour in slowly. Stir around the onions so that the flour coats them.
Turn the heat down to medium low so the flour doesn’t burn, and cook for 10 minutes to cook out the raw flour taste.
Add the beef broth, bring the soup back to a simmer, and cook for 10 minutes.
Season, to taste, with salt and pepper.
Ladle the soup into bowls, top each with 2 slices of bread and top with cheese.
Put the bowls into the oven to toast the bread and melt the cheese.