Heat the olive oil in a large pot and sauté the onions over medium heat for 8 minutes until golden brown.
Add the garlic and ginger and sauté for 2 minutes.
Stir in all the spices—ras el hanout, turmeric, saffron (soaked in water), cinnamon, and white pepper—and sauté for 1 minute.
Place the chicken in the pot, pour in the chicken broth, cover, and simmer over low heat for 40–45 minutes, until tender.
Remove the chicken, let it cool, and shred it finely using two forks.
Reduce the stock in the pot over medium heat, then stir in the beaten eggs and let them set while stirring—this creates a savory egg sauce.
Combine the shredded chicken, herbs, and egg mixture, then season to taste.
Brush a springform pan with melted butter.
Place the phyllo dough sheets in the pan so they overlap, brushing each sheet with butter and letting the edges hang over the sides.
Spread the almond mixture over the dough as the first layer.
Spread the chicken filling over the top.
Fold the overhanging edges of the dough over the filling, place additional buttered sheets of phyllo dough on top as a lid, and tuck them in.
Brush the surface generously with butter.
Bake in a preheated oven for 25–30 minutes, until the bastilla is golden brown and crispy.