Sunan Abi Dawud Book 28, Hadith 93
It is forbidden to eat garlic unless it is cooked.
Abu Dawud said: The full name of the narrator Sharik is Sharik bin Hanbal.
The Messenger of Allah (ﷺ) forbade these two plants (i.e. garlic and onions), and he said: He who eats them should not come near our mosque. If it is necessary to eat them, make them dead by cooking, that is, onions and garlic.
Khalid said: AbuZiyad Khiyar ibn Salamah asked Aisha about onions. She replied: The last food which the Messenger of Allah (ﷺ) ate was some which contained onions.