Have you considered the bit that panic attacks may be trying to teach or tell you something? Have you tried being mindful during the panic attacks? Are the symptoms purely physical? Maybe if you describe what happens and your state of mind/understanding during them, it would help us gauge where you're at.
In the case of the panic attacks, what happens is I wake up suddenly out of what seems to have been perfectly good, sound sleep, with my heart racing and my muscles feeling tense. It happens quickly enough that I can't tell whether the emotional panic was there before the physical symptoms, or whether the feeling of panic is a response to being jolted awake by heart palpitations and tension. I don't know of any lifestyle-related physical cause for this, since I was practically free of panic attacks for many years and nothing has changed in the last several days...except that I've been happy for a change.
With regard to the nightmares, I think it's quite likely that they're a manifestation of my mind trying to deal with situations I'm not doing anything about. Unfortunately I'm not doing anything about those situations because there is nothing productive and safe I can do about them. If I could go lucid I could probably use the dhamma in a dream the same way I do in waking life, but I seldom go lucid.
I guess another way to look at this is that I'm being presented with dhamma challenges when I'm at my most vulnerable. I don't know about anybody else but when I'm dead-to-the-world asleep, or suddenly awakened from it, I'm not likely to instantly think "this too shall change." But there are those lifestyles where it's expected, and really necessary, to be able to respond to a stressor in a functional, conditioned way, no matter what time of day or night the need arises. Firefighters and military personnel, for example, are trained to the point that if you wake them up with a sudden loud noise at 3am they will instantly be ready to get to work. I guess that's ultimately how it would be best to respond with dhamma...to get to the point where even in a dream, I think in a dhamma-oriented way. So perhaps in my case it's going to be a priority to make it that well-rooted, rather than a long-term goal.