The Messenger of Allah ﷺ traveled during Ramadan and fasted until he reached Usfan. Then he called for a vessel containing a drink and drank it during the day so that the people could see him, and he broke his fast until he entered Mecca.Ibn Abbas said, "The Messenger of Allah ﷺ both fasted and broke his fast, so whoever wishes may fast and whoever wishes may break his fast."
و حدثنا إسحق بن إبراهيم أخبرنا جرير عن منصور عن مجاهد عن طاوس
سافر رسول الله ﷺ في رمضان فصام حتى بلغ عسفان ثم دعا بإناء فيه شراب فشربه نهارا ليراه الناس ثم أفطر حتى دخل مكة قال ابن عباس رضي الله عنهما فصام رسول الله ﷺ وأفطر فمن شاء صام ومن شاء أفطر