The Messenger of Allah ﷺ said, "Whoever eats garlic or onion should keep away from us," or, "should keep away from our mosque and remain in his house."A platter containing some green vegetables was brought to him, and he detected an odor coming from it. He asked about it and was informed of the vegetables it contained. He said, "Bring it close to one of his companions who was with him." When the companion saw it, he disliked eating from it. The Prophet ﷺ said to him, "Eat, for I converse with one with whom you do not converse."Ahmad bin Salih said, the word "Badr" was explained by Ibn Wahb to mean a platter.
حدثنا أحمد بن صالح حدثنا ابن وهب أخبرني يونس عن ابن شهاب حدثني عطاء بن أبي رباح أن
إن رسول الله ﷺ قال من أكل ثوما أو بصلا فليعتزلنا أو ليعتزل مسجدنا وليقعد في بيته وإنه أتي ببدر فيه خضرات من البقول فوجد لها ريحا فسأل فأخبر بما فيها من البقول فقال قربوها إلى بعض أصحابه كان معه فلما رآه كره أكلها قال كل فإني أناجي من لا تناجي قال أحمد بن صالح ببدر فسره ابن وهب طبق
Bukhari narrated it in the Book of Adhan, the chapter on what has been said about raw garlic, onions, and leeks, hadith 855, from Ahmad bin Salih, and Muslim narrated it in the Book of Mosques, the chapter on the prohibition against eating garlic, onions, leeks, or similar foods with an offensive smell, and so on, hadith 73/564, from the hadith of Ibn Wahb, with the same chain.