Anas was asked about garlic, and he said that the Messenger of Allah ﷺ said, "Whoever eats from this plant should not come near us or pray with us."
و حدثني زهير بن حرب حدثنا إسمعيل يعني ابن علية
سئل أنس عن الثوم فقال قال رسول الله ﷺ من أكل من هذه الشجرة فلا يقربنا ولا يصلي معنا