The longer you cook the onions, the richer the flavour for this ... Grease a 20cm/8in or 23cm/9in tart tin with butter and line the tin with the pastry, pressing it into the edges.
A better option is to use a muffin tin, as has gone viral on TikTok ... and it goes well with just about any type of meat or fish. You can also serve the melted onions with roasted veggies ...