Narrated AbuSa'id al-Khudri: The garlic and onions were mentioned before the Messenger of Allah (ﷺ). He was told: The most severe of them is garlic. Would you make it unlawful? The Prophet (ﷺ) said: Eat it, and he who eats it should not come near this mosque until its odour goes away
Hadith No. 3823
Sunan Abu Dawud
Gradings:
Al-Albani:
Daif
Muhammad Muhyi Al-Din Abdul Hamid:
Daif
Zubair Ali Zai:
Isnaad Hasan