Abu Ayub reported,

Whenever the Messenger of Allah ﷺ was brought food, he would eat from it and send what remained to me. One day he sent me leftovers from which he had not eaten, because they contained garlic.I asked him, "Is it forbidden?"He replied, "No, but I dislike it because of its smell."

Azami 3155

Sahih

عن أبي أيوب الأنصاري قال

كان رسول الله ﷺ إذا أتي بطعام أكل منه، وبعث بفضله إلي، وإنه بعث إلي يوما بفضلة لم يأكل منها، لأن فيها ثوما. فسألته: أحرام هو؟ قال: لا ولكني أكرهه من أجل ريحه.

الأعظمي 3155صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Mosques
Section
Permissibility of eating garlic, and it is recommended to avoid it for one who wishes to visit elders
Numbering
Jami al-Kamil 3155 (2nd edition)
Azami 3155