Abu Hurairah reported,

The Messenger of Allah ﷺ said, "Whoever eats from this plant, garlic, should not disturb us with its smell in this mosque of ours."Ibrahim said that his father used to add leeks and onions to this hadith from the Prophet ﷺ, meaning that he would add them to Abu Hurairah's hadith which mentioned only garlic.

Ibn Majah 1015

Sahih

حدثنا أبو مروان العثماني حدثنا إبراهيم بن سعد عن ابن شهاب عن سعيد بن المسيب

عن أبي هريرة قال

قال رسول الله ﷺ من أكل من هذه الشجرة الثوم فلا يؤذينا بها في مسجدنا هذا قال إبراهيم وكان أبي يزيد فيه الكراث والبصل عن النبي ﷺ يعني أنه يزيد على حديث أبي هريرة في الثوم

ابن ماجه 1015صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Establishing prayer and the sunnah regarding it
Chapter
One who eats garlic should not approach the masjid
Numbering
Darussalam 1015
Ibn Majah 1015