01 - Preheat the oven to 400°F. Line a baking tray with parchment paper to prevent sticking.
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 often, until apples are soft and syrupy. Set aside to cool.
03 - Beat together the softened cream cheese, granulated sugar, and vanilla extract in a bowl until the mixture is smooth and creamy.
04 - Roll out the puff pastry on a lightly floured surface to smooth out any creases. Cut the pastry sheet into 8 equal squares.
05 - Place the pastry squares on the prepared baking tray. Lightly score a smaller square border inside each piece without cutting all the way through, and prick the center area with a fork.
06 - Spread a spoonful of the cream cheese filling in the center of each pastry, keeping it within the scored border. Top generously with the cooled apple mixture.
07 - Brush the exposed pastry edges with the beaten egg to promote golden browning.
08 - Bake for 18–22 minutes, or until the pastry is puffed and golden brown.
09 - Allow the danishes to cool slightly. If desired, mix powdered sugar with just enough milk or lemon juice to create a drizzle, and zigzag it over the pastries. Serve warm or at room temperature.