كتاب آداب السفر
7  
The Book of Etiquette of Traveling
(177)
Chapter: Supplication at the time of returning Home and on seeing one's Hometown
(177)
-باب ما يقول إذا رجع وإذا رأى بلدته
Riyad as-Salihin 987
Anas (May Allah be pleased with him) reported:
We returned with the Prophet (ﷺ) from a journey; and when we entered the suburbs of Al- Madinah, he (ﷺ) said: "Ayibuna, ta'ibuna, 'abiduna, li-Rabbina hamidun (We are returning in safety, turning to our Rubb, worshipping Him and praising Him)." He (ﷺ) continued repeating these words till we entered Al-Madinah.

[Muslim].

وعن أنس رضي الله عنه قال‏:‏ أقبلنا مع النبي صلى الله عليه وسلم ، حتي إذ كنا بظهر المدينة، قال‏:‏ ‏ "‏آيبون، تائبون ، عابدون ، لربنا حامدون‏"‏ فلم يزل يقول ذلك حتي قدمنا المدينة، ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏
Reference : Riyad as-Salihin 987
In-book reference : Book 7, Hadith 32