The Prophet ﷺ was on a military expedition when he said, "There are people we left behind in Madinah who have been with us through every mountain pass and valley we have traversed. It was a valid excuse that kept them back."
أن النبي ﷺ كان في غزاة فقال: إن أقواما بالمدينة خلفنا، ما سلكنا شعبا ولا واديا إلا وهم معنا فيه حبسهم العذر.
Bukhari narrated it in Jihad and Expeditions (2839) from Sulayman bin Harb, who said, Hammad bin Zayd narrated to us, from Humayd, from Anas, and he mentioned it. Ibn Majah narrated it (2764) through Ibn Abu Adi, from Humayd, with the same wording. In it, "When the Messenger of Allah ﷺ returned from the expedition of Tabuk and drew near to Madinah, he said," and then he mentioned something similar.Abu Dawud narrated it (2508) from Musa bin Ismail, who said, Hammad narrated to us, from Humayd, from Musa bin Anas bin Malik, from his father, that the Messenger of Allah ﷺ said, "You have left behind in Madinah people such that you have not traveled any distance, nor spent any expenditure, nor crossed any valley, but they were with you in it." They said, "Messenger of Allah, how can they be with us while they are in Madinah?" He said, "A valid excuse held them back."Ibn Hajar said in Taghliq Taliq (3/435), "In my view this is a sahih hadith, due to the excellence of its wording and the soundness of its narrators."