Demi Lovato has been receiving visits from ex Wilmer Valderrama in rehab

Demi Lovato still has the support of ex-boyfriend Wilmer Valderrama while in rehab.

A source tells ET that the 26-year-old singer is "doing well" following her overdose in July, and has been enjoying visits with her mother, Dianna De La Garza, as well as from Valderrama.

“She’s working very hard on bettering herself and staying on the right path," the source says. "Sobriety is the most important thing in Demi’s life right now."

"Demi has been fortunate to have her family and friends for support during this time," the source continues. "Demi’s mother and her ex, Wilmer, have visited her in rehab when they can.”

According to the source, the singer has also moved rehab facilities. TMZ was the first to report the news.

Lovato and 38-year-old Valderrama split in 2016 after six years together, but have clearly remained close. The former That '70s Show star was snapped multiple times visiting Lovato while she was hospitalized at Cedars-Sinai Medical Center following her overdose.

"Wilmer and Demi have always shared a strong bond, and Wilmer knows Demi better than anyone," a source told ET in July. "He's seen her highs and lows, and has always been there for her, and he knows she needs him now more than ever."

"After their 2016 breakup, Demi and Wilmer remained friends, and he knows Demi was going through a lot, but he didn't know it was this bad," the source added. "Right now, Wilmer is just trying to be there for Demi and be a solid friend to her."

On Tuesday, Lovato's mom talked about her daughter's overdose for the first time in a television interview with Newsmax TV and admitted she didn't know whether or not the "Skyscraper" singer would survive.

"She just didn't look good at all," De La Garza recalled. "She was in bad shape, but I said to her, 'Demi, I'm here, I love you.' And at that point, she said back to me, 'I love you too.' From that point on, I never allowed myself to ever think that things weren't going to be OK ... we just didn't know for two days if she was going to make it or not."