Sayyiduna Abu Tha'labah (may Allah be pleased with him) narrates that he took part in the expedition of Khaybar with the Prophet (peace and blessings be upon him). They found onions and garlic in its orchards, and the people began eating them because they were hungry. When the people came to the place of prayer, the smell of garlic and onion spread through the mosque. The Prophet (peace and blessings be upon him) said: "Whoever eats from this foul plant must not come near us." (Allamah al-Haythami says:) I say: He mentioned it within a long hadith.
Al-Tabarani recorded it in al-Mu'jam al-Kabir, and its chain is hasan (good).
Hadith Referenceمجمع الزوائد ومنبع الفوائد / كتاب الصلاة / 1998