Heat the butter in a large skillet over medium heat. Add the onions and a big pinch of salt. Stir to mix. Cook the onions for 15 to 20 minutes, stirring often, until they are translucent.
Reduce the heat to low. Continue to cook the onions, stirring often for at least 1 hour or even longer, until they are caramelly and golden. If at any time the onions seem too dry, you can always add in ¼ cup of water. Once the onions are caramelized to your liking, stir in the garlic. Cook for 30 seconds. Turn off the heat, set them aside and let them cool.
Preheat the oven to 425 degrees F.
Lay a sheet of puff pastry in a 9x13 baking sheet or dish. Poke it all over with a fork, this helps to keep it from bubbling up.
Whisk together the eggs, cream, almost all of the cheese and onions and fresh herbs until combined. Stir in a pinch of salt and pepper. Reserve some cheese and onions for the topping.
Pour the egg mixture into the puff pastry crust. Top with the remaining cheese.
Bake for 25 to 30 minutes, or until the center is no longer jiggly and the crust is golden. Remove and let cool slightly. Sprinkle with remaining caramelized onions and additional fresh herbs. Slice into squares to serve.