01 - Preheat oven to 400°F. Line a baking tray with parchment paper and set aside.
02 - In a skillet over medium heat, melt the butter. Add diced apples, brown sugar, cinnamon, nutmeg, and lemon juice. Cook for 6-8 minutes, stirring frequently, until apples are tender and coated in a thick syrup. Remove from heat and let cool completely.
03 - In a mixing bowl, beat together the softened cream cheese, granulated sugar, and vanilla extract until smooth and creamy. Set aside.
04 - Roll out the puff pastry on a lightly floured surface to smooth any creases. Cut into 8 equal squares and transfer to the prepared baking tray. Lightly score a smaller square border inside each piece without cutting all the way through, then prick the inner center area with a fork to prevent over-puffing.
05 - Spread a generous spoonful of cream cheese filling in the center of each pastry square, staying within the scored border. Top with a spoonful of the cooled apple mixture.
06 - Brush the exposed pastry edges with beaten egg to ensure a deep golden finish during baking.
07 - Bake for 18-22 minutes until the pastry is puffed and golden brown. Transfer to a wire rack to cool slightly.
08 - Mix powdered sugar with enough milk or lemon juice to reach a drizzle consistency. Use a spoon to zigzag the icing over the cooled danishes. Serve warm or at room temperature.