Put the onions, carrots, celery and sweet potato in a large flameproof casserole. Pour in the stock and bring to the boil.
Add the garlic, leeks, pearl barley, Puy lentils and sage. Season with salt and pepper. Stir to mix the vegetables together.
Cover and transfer to the preheated oven to cook for 30 minutes, then stir in the apple slices. Continue baking until the vegetables are just soft, and the barley and lentils are tender, about 30 more minutes.
Meanwhile, spread the hazelnuts in a single layer on a small baking tray. Bake in the oven alongside the casserole until fragrant, about 5 minutes. Remove from the oven, cool and chop coarsely.
Sprinkle the casserole with the parsley and hazelnuts and serve. Thick slices of crusty or soda bread are an excellent accompaniment.