Qurra bin Iyas reported,

The Messenger of Allah ﷺ forbade these two plants, saying, "Whoever eats them should not come near our mosque." He also said, "If you must eat them, then kill their pungency by cooking them." He meant onions and garlic.

Azami 7408

Hasan

عن قرة بن إياس

أن رسول الله ﷺ نهى عن هاتين الشجرتين فقال: من أكلهما فلا يقربن مسجدنا وقال: إن كنتم لا بد آكلوهما فأميتوهما طبخا، قال: يعني البصل والثوم.

الأعظمي 7408حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Foods
Chapter
Foods other than meat
Section
Eating garlic and onion when cooked
Numbering
Jami al-Kamil 7408 (2nd edition)
Azami 7408