In a large dutch oven over medium-high heat, melt the butter. Add the onion, and cook until softened, about 5 minutes.
Stir in the thyme, garlic, salt, and pepper, and cook until fragrant, about 30 seconds. Add the potatoes, broth, cream, and bay leaves.
Bring the mixture to a simmer. Reduce the heat to medium-low, cover, and cook, stirring occasionally, until the potatoes are almost tender, about 10 minutes.
Discard the bay leaves, and transfer the potato mixture to an 8-inch square baking dish. Gently press the potatoes into an even layer, and sprinkle the cheese evenly over the top.
Bake until the cream is bubbling around the edges and the top is golden-brown, about 20 minutes.
Let cool for 10 minutes before serving.
Notes
You can sub grated Parmesan cheese for the cheddar if you'd like (that's what's shown in the pictures).
Omit the thyme if you aren't a big fan.
Using a mandoline slicer or a v-blade slicer makes cutting the potatoes evenly thin much faster and easier; I'd recommend that or a food processor for the potato slicing.
This is a great dish to prep ahead of time so that you can throw it in the oven later.