Narrated `Abdul `Aziz
It was said to Anas "What did you hear the Prophet (ﷺ) saying about garlic?" Anas replied, "Whoever has eaten (garlic) should not approach our mosque."
Narrated Jabir bin `Abdullah
The Prophet (ﷺ) said, "Whoever has eaten garlic or onion should keep away from us (or should keep away from our mosque).'