Start by heating olive oil in a skillet over medium heat. Add the chopped onion and cook until soft and translucent. Stir in the garlic and spices, letting them bloom for a minute to release their aroma. Then add the shredded chicken and mix well.
Pour in the chicken broth and allow the mixture to simmer gently. This helps all the flavors combine beautifully. Stir in parsley and let the mixture cool slightly before adding eggs to bind everything together.
Roll out the puff pastry and place it into your baking dish. Spoon the chicken mixture evenly over the base. Cover with another layer of pastry or fold edges depending on your style.
Brush the top with egg wash for a golden finish. Bake in a preheated oven at 375°F (190°C) for about 30 minutes. The pastry should turn golden brown and crisp.
Once baked, let the pie cool slightly before serving. Sprinkle powdered sugar and sesame seeds on top if you like a traditional Moroccan presentation. Slice and enjoy warm.