(Imām Bukhārī narrates): Musaddad narrated to us, he said: Yahya narrated to us from Ubaidullah, he said: Nafi' narrated to me from Ibn Umar, may Allāh be pleased with them both, that
the Prophet ﷺ said during the battle of Khaybar: Whoever eats from this tree, that is garlic, should not come near our mosque.
Reference: Sahih Al Bukhari 853