The Messenger of Allah ﷺ said, "When one of you is invited, let him accept the invitation. If he is fasting, let him pray for his host, and if he is not fasting, let him eat."
قال رسول الله ﷺ: إذا دعي أحدكم، فليجب، فإن كان صائما فليصل، وإن كان مفطرا فليطعم.
Muslim narrated it in the Book of Marriage (1431), from Abu Bakr bin Abu Shayba, who said, Hafs bin Ghiyath narrated to us, from Hisham, from Ibn Sirin, from Abu Hurairah, who said, and then he mentioned it.