Sloan Mattingly, 7, died at the beach on Feb. 20 when a sand hole collapsed. GoFundMe

Following the suffocation death of a 7-year-old girl who got trapped in a sinkhole on a Florida beach earlier this year, town officials in Lauderdale-by-the-Sea have passed an ordinance in an effort to prevent similar tragedies.

Sloan Mattingly and her 9-year-old brother, Maddox, were digging for seashells during their family vacation at the beach on Feb. 20 when the sand hole collapsed on them. The sibling became trapped.

Bystanders were able to dig Maddox out in time, but Sloan died.

In response, the town passed an ordinance last week that prohibits beachgoers from digging holes deeper than 18 inches and orders the holes be filled before leaving, officials announced, according to WTVJ-TV, WPLG-TV, and WFOR-TV.

"When we go to the beach, we think of water safety. And this never, ever once crossed my mind," Sloan's mother, Therese Mattingly, told ABC News earlier this year.

Mattingly said the collapse happened "really fast."

"That part just hurts really bad because it didn't matter that we were literally right there," she said. "It was just a hole, and then there's nothing."

Lauderdale-by-the-Sea recently approved a "Sandcastles for Sloan" campaign to raise awareness about beach safety.