In a pan over medium heat, melt butter. Add the garlic and onions, cooking until translucent.
Add the spinach, salt, and pepper, cooking until spinach is wilted.
Add the breadcrumbs, cream cheese, parmesan, and dill, stirring until mixture is evenly combined. Remove from heat and set aside.
On a cutting board, smooth out the sheet of puff pastry. Place the salmon in the middle of the pastry and season both sides with salt and pepper.
Place several spoonfuls of the spinach mixture on top of the salmon, smoothing it out so that it does not spill over the sides.
Fold the edges of the puff pastry over the salmon and spinach, starting with the longer sides and then the shorter ends. Trim any excess pastry from the ends, then fold the ends on top. Flip the puff pastry-wrapped salmon over and transfer for a baking sheet lined with parchment paper.
Brush the beaten egg on the top and sides of the pastry. Score the top of the pastry with a knife, cutting shallow diagonal lines to create a crosshatch pattern.
Brush the top again with the egg wash.
Bake for 20-25 minutes, until pastry is golden brown.