Prepare the puff pastry by rolling it out and lining your pie dish with half of it.
Fill the pastry with the cheese and onion mixture, spreading it evenly.
Assemble the top crust with the remaining puff pastry, sealing the edges tightly.
Egg wash the top with the beaten egg for a golden finish.
Bake in the oven for 30-35 minutes until golden brown.
Rest the pie for a few minutes before slicing.
Notes
For added flavor, consider incorporating herbs like thyme or a pinch of chili flakes. This pie can be prepared in advance and stored in the fridge or freezer.