From what I've heard, putting a 6"x6" barrier like a piece of old carpet, or rubber mat (or even
cardboard, I'm sure) snugly around the base of each plant as you put them in the ground supposedly stops the flies laying their eggs close
enough for the
maggots to reach the
roots. I've tried it, but I don't actually know if it worked or not: my cabbages were fine, but then, I've only ever had attacks on my turnips (which were just too labor intensive to put a barrier on each). Good luck.