Melt the butter in a large heavy pot over low heat. Add the onions, leeks, shallots, and garlic and cook, covered, over low heat until the vegetables are tender and lightly colored, about 25 minutes.
Add the stock, thyme, and bay leaf, and season with salt and pepper. Bring to a boil, reduce the heat, and cook, partially covered, for 20 minutes.