
Islamic scholars explain that eating and drinking in the mosque is allowed. This is based on the saying of Abdullah bin Harith رضي الله عنه, who said that during the time of the Prophet ﷺ, they used to eat bread and meat in the mosque (Sunan Ibn Majah 3300).
Because of this evidence, scholars permit eating and drinking in the mosque. However, they say it is better to be careful. If someone needs to eat, they should spread something on the floor to protect the mosque from dirt, and no food pieces should remain.
Imam Nawawi رحمه الله said that there is no harm in eating, drinking, placing a dining mat, or washing hands in the mosque.
Imam Zarkashi رحمه الله said that eating bread, fruits, watermelon, and similar foods in the mosque is allowed. He added that one should spread something and avoid any dirt so insects do not gather.