01 - Preheat oven to 400°F. Line a baking tray with parchment paper.
02 - Melt butter in a skillet over medium heat. Add diced apples, brown sugar, cinnamon, nutmeg, and lemon juice. Cook for 6–8 minutes, stirring often, until apples are soft and syrupy. Allow to cool slightly.
03 - Beat together cream cheese, sugar, and vanilla extract in a bowl until the mixture is smooth and creamy.
04 - Roll out puff pastry on a floured surface to smooth any creases. Cut into 8 equal squares.
05 - Place squares on the prepared tray. Lightly score a smaller square inside each (do not cut all the way through) and prick the center area with a fork.
06 - Spread a spoonful of cream cheese filling in the center of each pastry. Top with a spoonful of the cooled apple mixture.
07 - Brush the exposed edges of the pastry with the beaten egg.
08 - Bake for 18–22 minutes, or until golden brown and puffed.
09 - Allow to cool slightly. For the optional icing, mix powdered sugar with enough milk or lemon juice to create a drizzle consistency and zigzag over the danishes.