Heat the olive oil in a large saucepan. Add the onions, cover the pan and leave to cook for around 15 minutes, or until they are soft and translucent, occasionally stirring. Add the chicken, coriander, garlic, ras el hanout, turmeric, ginger, pepper and ½ tsp salt. Stir to combine and cook, uncovered, for 5 minutes.
Pour in the chicken stock and bring to the boil over a high heat. Cover the pan, reduce the heat to medium–low and leave to simmer gently, stirring occasionally, for 50 minutes, until the chicken is cooked through. Add a few tablespoons of water if it looks dry at any point. Remove the chicken from the pan with a slotted spoon and set aside to cool. Once cooled, cut into 1cm/½ in pieces and return to the fridge until ready to use.
Stir the honey and 1 teaspoon of cinnamon into the pan and continue cooking over a medium–low heat, uncovered and stirring occasionally, for 50 minutes, until the onions are golden brown and all the liquid has evaporated. Leave to cool.
Meanwhile, prepare the rest of the filling. Preheat the oven to 200C/180C Fan/Gas 6. Spread the almonds and pistachios over a baking tray and roast for about 10–12 minutes, giving them a good stir halfway through to ensure even roasting. Remove from the oven and leave to cool to room temperature. Grind using a food processor or crush with a rolling pin or pestle until coarsely ground. Mix with the caster sugar and the remaining cinnamon in a small bowl.
Melt 10g/1/3oz of butter in a small frying pan. Break the 5 eggs into the pan, add a pinch of salt and cook, while stirring, for a few minutes until scrambled and fully set. Transfer to a bowl and leave to cool.
Melt the remaining butter. Use a sharp knife to cut the filo pastry sheets into twelve 22-cm/8½in squares. Keep them covered with a tea towel to prevent drying out. Lay a filo square on a work surface and lightly brush with melted butter, then top with another filo pastry square and brush with butter. Place the two layers of filo in a small, shallow dish that is around 10cm/4in in diameter, with any excess pastry overhanging the edges.
Preheat the oven again to 200C/180C Fan/Gas 6 and line a baking tray with baking paper.
Add the filling ingredients to the dish in the following order: chicken pieces, onions, scrambled eggs, ground nuts and lemon zest. Each portion should be enough to cover the base of the dish, bearing in mind that you will need six portions of all of the fillings for each pie.
Fold the overhanging pastry over the top of the filling and brush lightly with melted butter. Carefully flip the pies over and remove from the dish. Brush with the remaining egg yolk and place on the lined baking tray. Repeat with the remaining filo squares and fillings until you have six pies. Bake for 25 minutes, or until the pies are golden.
Stir the olive oil, thyme and lemon juice together in a small bowl until combined. Toss the dressing with the orange segments, carrot and cucumber ribbons, olives and walnuts in a large bowl and sprinkle with sea salt flakes.
Dust the bastillas with icing sugar and cinnamon and serve with the salad.