Modern Family” beauty Sofia Vergara slapped ladies’ man Joe Manganiello with a stinging “cheat on me and we’re through” ultimatum after he popped the question. 

All because her ex-fiancé, Nick Loeb, reportedly two-timed her with a pair of hookers during drug-fueled orgies!

“Sofia was hurt so deeply at the time, I think it permanently scarred her. She developed severe trust issues,” said a source close to the Latina spitfire, 42. 

“Sofia loves Joe and doesn’t think he’d ever do anything like that to her. But she knows women flock to him, and she isn’t taking any chances!”

In June 2012, two escorts claimed to  The ENQUIRER exclusively that Nick regularly dropped wads of cash on up to five $1,000-a-night prostitutes at a time during all-night, partner-swapping parties in hotels in New York and Miami – while he was still dating Sofia!

Nick’s frequent sex partners – identified only as “Cindy” and “Bianca” to protect their identities – described their intimate encounters with him in detail, and claimed he had wild sex with other prostitutes!

Although he denied the allegations, Bianca claimed Nick craved sex constantly.

“He’ll party with anywhere from two to five girls, usually in a luxury hotel penthouse, with porn playing on all the TVs, lines of cocaine laid out and liquor flowing like water,” claimed Bianca. 

“He takes large doses of Viagra and provides sex toys, lingerie and drugs, including ecstasy. He doesn’t use it, but he likes the girls to take it because he believes it makes them enjoy sex more.”

Nick – a trust fund kid turned food product entrepreneur – allegedly told the women that his fiancée Sofia didn’t share his interest in kinky sex.

Bianca claimed: “He told me, ‘Sofia won’t even talk about it!’” And, added Cindy: “Nick was willing to risk his future with her for his own selfish pleasure.”

But “Magic Mike” hunk Joe, 38, has insisted that sort of thing would never happen to him. 

The 6-foot-5 former “True Blood” star said he’s matured since his younger days, when he was a drinker and womanizer.

He’s been off the sauce for 11 years and ended an engagement to blonde bombshell Audra Marie in 2011.

Added the source: “It looks like Joe’s finally found his perfect match in Sofia! They were made for each other.”