Dealing with Depression and Anxiety

My boyfriend and I have been together for almost 9 months now. It's been a great 9 months too. We've always done our best to be there for each other and to communicate properly. I noticed that after about a month, mid April, in quarantine something in me snapped. A voice in my head told me I didn't love him. I do love him so much, hes is such an amazing person. When that happened it sent me into a spiral. I hate myself for even thinking that. I started having panic attacks multiple times a day. The only times I felt better were when I was with him. He held me and told me it would be okay. I feel safe with him. When I'm with him, I didn't doubt a thing I was just happy. I've been like this for almost two months now and don't know how to make it stop. He thinks that I'm just not allowing myself to be happy because of my previous relationship where I got assaulted. I think he's right, but I dont know how to get better.