The Prophet ﷺ said, "When you go to relieve yourselves, do not face the qiblah, nor turn your backs to it. Rather, face east or west."Abu Ayub said, "When we came to Sham, we found that the latrines had been built facing the qiblah, so we would turn aside and ask Allah the Exalted for forgiveness."Zuhri reported from Ata, who said, "I heard Abu Ayub narrate the same from the Prophet ﷺ."
حدثنا علي بن عبد الله قال حدثنا سفيان قال حدثنا الزهري عن عطاء بن يزيد الليثي
أن النبي ﷺ قال إذا أتيتم الغائط فلا تستقبلوا القبلة ولا تستدبروها ولكن شرقوا أو غربوا قال أبو أيوب فقدمنا الشأم فوجدنا مراحيض بنيت قبل القبلة فننحرف ونستغفر الله تعالى وعن الزهري عن عطاء قال سمعت أبا أيوب عن النبي ﷺ مثله