It is narrated from Sayyiduna Abu Tha'labah (may Allah be pleased with him) that he took part in the campaign of Khaybar with the Messenger of Allah (peace and blessings be upon him). The people were struck by hunger, and they found some domestic donkeys there, so the people slaughtered some of them. The Prophet (peace and blessings be upon him) was informed of this, and he (peace and blessings be upon him) ordered Sayyiduna Abd al-Rahman bin Awf (may Allah be pleased with him), who announced among the people: The meat of domestic donkeys is not lawful for anyone who bears witness that I am the Messenger of Allah. So the people overturned their cooking pots with the (meat) that was in them. Then they found onions and garlic in its gardens; being hungry, they ate from them and were afflicted (by it). When the people went to the mosque, the mosque was filled with the smell of onions and garlic. The Prophet (peace and blessings be upon him) said: "Whoever eats from this foul-smelling plant (onion, garlic), let him not come near us."
Hadith Referenceالمعجم الكبير للطبراني / باب اللام ألف / 18794