Foods (besides prunes) that help my 1 year old poop help

So she has always had constipation problems and at 6 months old they gave me lactulose to give when constipated but it doesn’t work very well. I have just started doing research because it’s getting much worse to the point where she’s pushing so hard she’s shaking and crying so hard and huge hard poops come out every 1-2 weeks. Imso worried. I have had many dr phone calls and visits and they have not helped at all. Anyways with the research I’ve done I realized I have been giving her lots of bread , and pasta , applesauce, bananas occasionally and that’s why it’s been so much worse. I give her pears almost everyday and that has done nothing for her. What foods should I focus on giving her everyday??? She eats a lot of green beans too and drinks lots of water. And the reason I say no to prunes is because at around 4 months she was so constipated they had us start her on baby food and she had an allergic reaction after I fed her some prunes