Constipation

My daughter been constipated since 5 months shes now 1 years old, at 9 months they gave her laxative to help her, but after her recent doctor visit they say she shouldn’t be on medication at 1 to poop. They told me to try a suggestion and if it doesnt work bring her back, What would have to happen, would she have to get surgery or something?