Take the puff pastry out of the freezer. Let it sit at room temperature for 25-30 mins. Or, if it was put it in the refrigerator, take it out 2 hours before cooking.
Mince the garlic, and chop the onion.
Put the pot on stove top, and turn heat to medium. Add the chopped onion. Stir until translucent.
Open the salmon can. Smash it in a small bowl. Stir in the salmon at medium heat to mix well with the onion. Add the minced garlic and stir for 2-3 mins.
Add the spinach. Continue mixing until all spinach leaves are cooked.
Stir in the salt, black pepper, and cream cheese. Mix until all the cream cheese melts with the rest of mixture.
Put the pot in a cold water bath to cool down. Add ice if you have it to make it cool faster.
Set the oven to 400F.
Unroll (unfold) the puff pastry to make it flat. Cut it to four pieces.
Whip the egg in the small bowl
When the salmon mixture is completely cool, put 3-4 tbsp of it onto the pastry.
Fold the pastry. Use a fork to press the edges. Brush the pastry with the whipped egg.
Put the pastry into the oven and bake for 20-25 mins.