Heat oil in a large pot over medium-high heat. Add the onions and salt and toss to coat evenly with the oil. Lower the heat to medium-low, cover and cook, stirring occasionally, sweating the onions until they are softened, about 15 minutes.
Remove the lid and continue to cook uncovered, stirring occasionally another 15 to 20 minutes until most of the residual moisture has evaporated, but don’t cook long enough to caramelize. Add the garlic and bay leaves and cook for another 3 minutes until fragrant. Stir in the flour and then the port wine. Add the hot beef broth and stir to combine. Season with more salt and pepper. Partially cover with a lid and simmer on low for about 45 minutes, stirring occasionally, skimming impurities, and adjusting seasoning as needed (don’t be stingy on the pepper!).
Meanwhile preheat the oven or toaster oven to 375 degrees F. Toss the bread cubes with the olive oil or spray them with olive oil spray, and toast in the oven for about 15 to 20 minutes until golden and crusty. Set aside.
Turn on the broiler. Divide the soup into 4 oven-proof bowls, top with the croutons (about 1 cup per serving), and then finish with 2 to 3 ounces of grated Gruyère per serving. Broil until cheese is melted, bubbly, and golden.