Sahih Muslim · Hadith 1278
The Book of Mosques and Places of Prayer - كتاب الْمَسَاجِدِ وَمَوَاضِعِ الصَّلاَةِ
وحدثني زهير بن حرب، حدثنا إسماعيل، - يعني ابن علية - عن عبد العزيز، - وهو ابن صهيب - قال سئل أنس عن الثوم، فقال قال رسول الله صلى الله عليه وسلم " من أكل من هذه الشجرة فلا يقربنا ولا يصلي معنا " .
Ibn Suhaib reported: Anas was asked about the garlic; he stated that the Messenger of Allah (may peace be upon him) had said: He who eats of this plant (garlic) should not approach us and pray along with us.
Gradings are classical jarḥ-wa-taʿdīl, name-matched to a rijāl index (not individually re-verified).