What is the ruling on the one who has his feet facing toward the qiblah in the mosque? Is it permissible to eat or sleep in a mosque?.
There is nothing wrong with a Muslim stretching out his feet or one foot towards the qiblah, whether in a mosque or elsewhere, and there is nothing wrong with him eating in a mosque or sleeping there if he needs to do that. But he should preserve the cleanliness of the mosque, and if he has a wet dream while asleep therein, he must hasten to leave when he wakes up to do ghusl because of janaabah.
And Allaah is the source of strength. May Allaah send blessings and peace upon our Prophet Muhammad and his family and companions. End quote.
Standing Committee for Academic Research and Issuing Fatwas