We were with the Prophet ﷺ on a journey when rain fell upon us. The Prophet ﷺ said, "Whoever wishes may pray in his quarters."
حدثنا أبو حفص عمرو بن علي البصري حدثنا أبو داود الطيالسي حدثنا زهير بن معاوية عن أبي الزبير
كنا مع النبي ﷺ في سفر فأصابنا مطر فقال النبي ﷺ من شاء فليصل في رحله
Muslim also narrated it in the Book of the Traveler's Prayer, chapter on praying in one's dwelling during rain, hadith no. 698, through the narration of Zuhayr bin Muawiya with the same wording, and it is also found in the Musnad of Abu Dawud Tayalisi, hadith no. 1736.On this same subject, it is also narrated from Ibn Umar [Bukhari, no. 666, and Muslim, no. 697], from Samura [Ahmad: 5/1378, 19, 15, 22, 74], from Abu Malih on the authority of his father [Abu Dawud: 105], and from Abdul-Rahman bin Samura [Ahmad: 5/62, and Ibn Khuzayma, no. 1862].