Jabir bin Samura reported,

The Messenger of Allah ﷺ stayed as a guest at the home of Abu Ayub. Whenever Abu Ayub prepared a meal, he would send the leftover portion to the Prophet ﷺ. One day he sent him some food, but the Prophet ﷺ did not eat from it.When Abu Ayub came to the Prophet ﷺ, he mentioned this to him.The Prophet ﷺ said, "It contained garlic."Abu Ayub asked, "Messenger of Allah, is it forbidden?"He replied, "No, but I dislike it because of its smell."

Tirmidhi 1807

Sahih

حدثنا محمود بن غيلان حدثنا أبو داود أنبأنا شعبة عن سماك بن حرب سمع

جابر بن سمرة يقول

نزل رسول الله ﷺ على أيوب وكان إذا أكل طعاما بعث إليه بفضله فبعث إليه يوما بطعام ولم يأكل منه النبي ﷺ فلما أتى أبو أيوب النبي ﷺ فذكر ذلك له فقال النبي ﷺ فيه ثوم فقال يا رسول الله أحرام هو قال لا ولكني أكرهه من أجل ريحه

الترمذي 1807صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami Tirmidhi
Book
Foods
Chapter
Dislike of eating garlic and onions
Numbering
Darussalam 1807
Tirmidhi 1807