Is it safe to take phenytoin while pregnant or breastfeeding?

No. Phenytoin use during pregnancy has been associated with many fetal abnormalities including, head and facial abnormalities, brain abnormalities, and development delays. "fetal hydantoin syndrome" is a disorder in infants characterized by many of these abnormalities.
Not during pregnancy. This is a category d drug with known fetal toxicity. A syndrome of abnormalities is well known. It is considered relatively safe during breastfeeding.