Preheat the oven to 180C/gas mark 4.
To begin, cut the ox cheeks into four pieces and season with salt.
Add a splash off vegetable oil to a heavy-based (ideally oven-proof) saucepan, casserole, or Dutch oven, and heavily sear the ox cheek in batches, so to avoid overcrowding the pan. Set aside, with their cooking juices.
Once the ox cheek is seared, add the onion, carrot, leek and celery to the empty pan. Sauté for a few minutes over a medium-high heat, until the vegetables begin to colour, being careful to avoid burning the onions.
Add the garlic, bay leaves, thyme, and peppercorns, and continue to cook for another minute. Add the stout or porter to the pan and increase the heat. Cook until the beer has reduced by at least half.
At this point, add the ox cheek and their accumulated juices back to the pan, followed by the chicken stock. Stir to combine and bring to a rolling boil, cover with the cartouche (but not a lid), and cook in the oven for 3 hours, or until tender.
While the ox cheek is cooking, thinly slice the remaining onions and add to a pan with approx. 50g butter and cook over a low heat until golden. This can take anywhere from 30 minutes to an hour. Once cooked, remove from the pan and set aside. (You can add a tablespoon of sugar at this point, to speed up the process, but it will slightly impact the overall quality and taste of the caramelised onions).
Meanwhile, peel and thinly slice the carrots. Add to a pan with a dash of cooking oil and three star anise. Slowly cook until soft and the edges begin to colour. Once cooked, remove from the pan and set aside.
Once the ox cheeks have cooked, allow to cool in the cooking liquid for around 20 minutes. Strain the cooking liquor into a clean saucepan and cook over high heat to reduce to an ideal gravy thickness, skimming any impurities that rise to the top.
Once cool enough to handle, shred the ox cheek, discarding the vegetables.
Fill a pie dish or cast iron skillet with a layer of caramelised onions, topped by the carrots, then the ox cheek. Once thickened, pour some gravy over the pie filling, reserving some for serving. Season with salt and pepper.
Drape the pastry over the top of the pie, allowing it to overhang the pie dish by approx. 1cm. Alternatively, layer thin strips of pastry (see photograph). Tuck this excess pastry between the dish and filling, to compensate for shrinkage while cooking. Brush with a beaten egg or a splash of milk and bake in the oven at 190C/gas mark 5 for 15 minutes, or until golden.