The Messenger of Allah ﷺ said, "When one of you goes to relieve himself, he should neither face the qiblah nor turn his back to it. Rather, face east or west."Abu Ayub said, "When we came to Sham, we found the latrines built facing the qiblah, so we would turn aside and ask Allah for forgiveness."
حدثنا إسماعيل أخبرنا معمر عن الزهري عن عطاء بن يزيد
قال رسول الله ﷺ إذا أتى أحدكم الخلاء فلا يستقبل القبلة ولا يستدبرها وليشرق وليغرب قال أبو أيوب فلما أتينا الشام وجدنا مقاعد تستقبل القبلة فجعلنا ننحرف ونستغفر الله عز وجل