I heard the Messenger of Allah ﷺ say, "When a man performs ablution and then comes to the mosque, Allah records ten good deeds for him with every step he takes. When he prays in the mosque and then remains seated there, he is like one who fasts and devoutly worships until he returns home."
حدثنا يحيى بن إسحاق أخبرنا ابن لهيعة عن شيخ من معافر قال سمعت
سمعت رسول الله ﷺ يقول إذا توضأ الرجل فأتى المسجد كتب الله عز وجل له بكل خطوة يخطوها عشر حسنات فإذا صلى في المسجد ثم قعد فيه كان كالصائم القانت حتى يرجع