Preheat the oven to 200°C
Heat half of the olive oil in a frying pan over a medium-high heat. Add the onions and stir-fry for a couple of minutes. Reduce the heat to low and cook for 30 minutes, stirring regularly. Remove the onions from the pan and keep them warm.
Increase the heat back to medium, add the remaining oil and gently fry the fennel for 5 minutes. Add the garlic and cook for a further 10 minutes. Next add the mushrooms and cook for 5 minutes before adding the sugar, stout and thyme leaves and cook for a further 5 minutes. Add the onions back into the pan, season with salt and pepper and cook until the liquid has evaporated (approx. 5 – 10 minutes). Remove from the heat and allow to cool.
Line a baking tray with baking paper and lay the sheet of puff pastry onto this. Take a sharp knife and score a rectangle into the puff pastry sheet about 2 cm from edge to form a border. Spoon the onion and mushroom mix within the scored area, making sure not to get any on the border. Crumble the goats cheese evenly over the mixture. Brush the puff pastry border with the beaten egg and pop in the oven for 12 to 15 minutes, until the borders have risen with a dark golden brown colouring.
Enjoy with a simple rocket salad and glass of Clyde Puffer.