Peel the onions, then cut them in half, then into half-moon shapes around 3-4mm (⅛-¼") thick.
Heat the cooking oil in a heavy-based frying pan (28cm or 11" and not non-stick) over a medium-high heat.
Add in the curry leaves, slit green chillies, ajwain, mustard, fennel, and cumin seeds, then cook for 30 seconds.
Add the garlic and ginger, then cook for 30 seconds.
Throw in the onions and stir, reduce the heat to low-medium, and allow to slowly cook until the onions caramelise. This should take approximately 45 minutes.
De-seed the tomato and cut the flesh into a 1cm (½") dice (discard the seeds).
Stir in the turmeric, ground coriander, and tomatoes, stir and set aside until you are ready to build the biryani.
Cook the rice:
Wash the basmati rice thoroughly and allow it to soak in cold water for 20 minutes.
Add all of the remaining ingredients for the rice into a pan (15-16cm or 6") with the cold water and bring to a rolling boil. Reduce the heat to a gentle simmer.
Add the soaked and washed rice to the water and add a lid.
Cook for 9-10 minutes (the rice should be very nearly cooked), then remove from the heat and allow to steam with the lid on for 5 minutes.
Spread the rice on a plate or tray to cool quickly, and when cooled, keep refrigerated until needed.
Cook the Mushrooms:
Cut the mushrooms into 5mm-7mm thick slices.
Heat the oil for the mushrooms over a medium heat and add the asafoetida and cook for 30 seconds, stirring continuously.
Add the mushrooms and cook for 10 minutes.
Mix together the garam masala, Kashmiri chilli powder, garlic powder, onion powder, ground turmeric, ground coriander and Salt
Once the mushrooms have had 10 minutes and are nicely browned, add the spice mix and stir for 30 seconds.
Pour in the water, reduce the heat to low and add a lid, then cook for a further 10 minutes.
Build and Cook the Biryani:
Take two oven-safe dishes that hold around 500ml of liquid or one oven-safe bowl that holds around 1 litre of water.
Add a quarter or half of the onion mix (depending on whether you are using 2 or one bowl) to the base of the bowl, then a quarter or half of the mushroom mix and follow up with a third or a sixth of the rice.
Repeat the process finishing the dish off with a layer of rice.
If you are adding saffron, heat the milk in a pan until it is warm but not boiling and add the saffron, swirl until the milk begins to take on the colour, then pour over the top of the biryani.
Cover the dishes or dish with foil and bake at 180°C or 350°F for 35 minutes, remove the foil and then bake for a final 5 minutes.