The Prophet ﷺ forbade these two plants and said, "Whoever eats them should not come near our mosque." He also said, "If you must eat them, then kill them by cooking."The narrator said, he meant onions and garlic.
حدثنا عباس بن عبد العظيم حدثنا أبو عامر عبد الملك بن عمرو حدثنا خالد بن ميسرة يعني العطار
أن النبي ﷺ نهى عن هاتين الشجرتين وقال من أكلهما فلا يقربن مسجدنا وقال إن كنتم لا بد آكليهما فأميتوهما طبخا قال يعني البصل والثوم