I found this KB article very useful. I have tried it on many failed laptops and it has worked.

I just resolved my disappearing Optical drive problem by resetting my BIOS settings to default. It worked on my HP Pavilion tx1327 cl. Try it and see if it works for your model.