It is narrated from Sayyiduna Abdullah bin Abbas (may Allah be pleased with them both) that the Messenger of Allah (peace and blessings be upon him) said: "Whoever eats anything from these vegetables of yours must not come near our mosque, for the angels are harmed by what the children of Adam are harmed by."
Imam Diya al-Din al-Maqdisi (may Allah have mercy on him) said: "Regarding Abdullah bin Ja'far, I cannot say with certainty whether he is al-Madini, al-Barmaki or al-Raqqi; for al-Madini, that is Abu Ali, has been criticised, whereas al-Barmaki and al-Raqqi are both thiqah (trustworthy). However, this hadith has a supporting narration (shahid) in the Sahih (al-Bukhari and Muslim) through more than one chain, about eating garlic, onions and leeks."