Sitting in a mosque with one's feet towards the qiblah
Question

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?.
Praise be to Allah.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 Allah is the source of strength. May Allah send blessings and peace upon our Prophet Muhammad and his family and companions. End quote. 
Standing Committee for Academic Research and Issuing Fatwas