Quick question ladies (TMI...kinda)

Eboni • My family is my blessing. My son is my life. ❤ 5/4/17
I've been having some bad problems with my bowels and my gallbladder during the end of my second trimester of my first pregnancy, I went to the hospital last night for some discomfort (the baby is fine, thank god) and was told by an OB there that I could take Miralax to help with the constipation and such but I bought the generic version called Smoothlax and am wondering if it's okay to take? Has any other women taken a laxative while pregnant? I'm a first time mom so I'm probably super cautious over nothing but I'd rather be safe than sorry 😂