The Messenger of Allah ﷺ said, "Whoever eats from this," — saying the first time, "garlic," then saying, "garlic, onions, and leeks" — "let him not come near us in our mosque."
حدثنا إسحق بن منصور أخبرنا يحيى بن سعيد القطان عن ابن جريج حدثنا عطاء
قال رسول الله ﷺ من أكل من هذه قال أول مرة الثوم ثم قال الثوم والبصل والكراث فلا يقربنا في مسجدنا
Agreed upon [by Bukhari and Muslim]. Bukhari narrated it in the Book of Adhan, chapter on what has been said concerning raw garlic, onions, and leeks, hadith no. 854, 855, and Muslim narrated it in the Book of Mosques, chapter on the prohibition of one who eats garlic, onions, leeks, or the like of foul-smelling things... etc., hadith no. 74, 75/564, from the hadith of Ibn Jurayj, with this wording.On this topic, there are also narrations from Umar [Muslim, no. 567], Abu Ayub [Muslim, no. 2053], Abu Hurairah [Muslim, no. 563, and Ibn Majah, no. 1015], Abu Saeed [Muslim, no. 566], Jabir bin Samura [to come, no. 1807], Qurra bin Iyas Muzani [Abu Dawud, no. 3827], and Ibn Umar [Bukhari, no. 853, and Muslim, no. 561, and Ibn Majah, no. 1016].