Ibn 'Umar reported: The Messenger of Allah (ﷺ) said: He who eats of this (offensive) plant must not approach our mosque, till its odour dies: (plant signifies) garlic.
Hadith ReferenceSahih Muslim / The Book of Mosques and Places of Prayer / Hadith: 561