(17) باب نَهْىِ مَنْ أَكَلَ ثُومًا أَوْ بَصَلاً أَوْ كُرَّاثًا أَوْ نَحْوَهَا عَنْ حُضُورِ الْمَسْجِدِ
Ibn Suhaib reported:
Anas was asked about the garlic; he stated that the Messenger of Allah (ﷺ) had said: He who eats of this plant (garlic) should not approach us and pray along with us.
Reference: Sahih Muslim 562 a
In-book reference: Book 5, Hadith 88
USC-MSA web (English) reference(deprecated numbering scheme): Book 4, Hadith 1143
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.