01 - Preheat oven to 400°F. Line a baking sheet with parchment paper.
02 - Melt butter in a small pan over medium heat. Add diced apple, brown sugar, cinnamon, and lemon juice. Cook, stirring, for 3–4 minutes until apples are soft and syrupy. Remove from heat and let cool.
03 - In a bowl, mix cream cheese, granulated sugar, and vanilla extract until smooth.
04 - Roll out puff pastry and cut into 8 equal squares.
05 - Place squares on the prepared baking sheet. Score a border about 1/2 inch from the edge, being careful not to cut through the pastry.
06 - Spread 1 tbsp of cheese filling in the center of each square. Top with a spoonful of the cooled apple mixture.
07 - Brush the edges of the pastry squares with the beaten egg.
08 - Bake for 18–20 minutes or until pastries are golden and puffed.
09 - Cool for 10 minutes. Whisk powdered sugar with milk to form icing, then drizzle over danishes if desired.