Sayyiduna Ma'qil bin Yasar (may Allah be pleased with him) said: We were with the Messenger of Allah (peace and blessings be upon him), and we came to a place where there was garlic. Some people ate from it and then came to the place of prayer. The Messenger of Allah (peace and blessings be upon him) noticed its smell and said: "Whoever eats from this plant (that is, garlic), let him not come near our place of prayer."
Hadith Referenceالمعجم الكبير للطبراني / باب الميم / 17654