01 - Preheat the oven to 400°F. Line a standard baking sheet with parchment paper.
02 - In a skillet over medium heat, melt the butter. Add the diced apples, brown sugar, cinnamon, nutmeg, and lemon juice. Cook for 6 to 8 minutes, stirring frequently, until the apples are soft and coated in a thick syrup. Remove from heat and let cool.
03 - In a mixing bowl, beat the softened cream cheese, granulated sugar, and vanilla extract together until completely smooth and creamy.
04 - Unfold the puff pastry onto a lightly floured surface, rolling gently to smooth out any creases. Cut the dough into 8 equal squares. Transfer the squares to the prepared baking sheet. Lightly score a smaller square border inside each piece without cutting all the way through the dough, and prick the inner center several times with a fork.
05 - Spread a generous spoonful of the cream cheese mixture inside the scored border of each pastry square. Top the cream cheese with an equal portion of the cooled apple mixture.
06 - Using a pastry brush, lightly coat the exposed outer edges of the pastry dough with the beaten egg to ensure a golden, shiny finish.
07 - Bake for 18 to 22 minutes, or until the pastry is deeply golden brown and uniformly puffed. Transfer to a wire rack to cool slightly.
08 - In a small bowl, whisk the powdered sugar with milk or lemon juice until it reaches a drizzling consistency. Use a spoon to zigzag the glaze over the warm pastries. Serve immediately or at room temperature.