Hadithcore
Riyad as-Salihin, 1055

Ubayy bin Ka'b (May Allah be pleased with him) reported:

There was a man of the Ansar whose house was the farthest from the mosque. As far as I know, he never missed Salat (in congregation). It was said to him: "If you buy a donkey, you may ride upon it in the dark nights and in the hot days." He said: "I do not like that my house should be situated close to the mosque. I desire that my walking towards the mosque and returning home be recorded to my credit." Upon this the Messenger of Allah (ﷺ) said, "Allah has gathered all (rewards) for you." <b>[Muslim]</b>.

-وعن أبي بن كعب رضي الله عنه قال‏:‏ كان رجل من الأنصار لا أعلم أحدًا أبعد من المسجد منه، وكانت لا تخطئه صلاة‏!‏ فقيل له‏:‏ لو اشتريت حمارًا تركبه في الظلماء وفي الرمضاء قال‏:‏ ما يسرني أن منزلي إلى جنب المسجد إني أريد أن يكتب لي ممشاي إلى المسجد، ورجوعي إذا رجعت إلى أهلي، فقال رسول الله صلى الله عليه وسلم‏:‏ ‏

‏قد جمع الله لك ذلك كله‏

‏ ‏(‏‏(‏رواه مسلم‏)‏‏)‏‏.‏

References1 variant
In-Book Reference
Book 8, Hadith 65
Sharh · explanationclick to expand
<b>Guidance from the Hadiths:</b><br> 1) It is better to walk to the mosque than to ride to it, unless walking involves difficulty. The easier, the better, for the Prophet (may Allah’s peace and blessings be upon him) “was never given a choice between two things except that he would choose what was easier, unless it was a sin.” [Narrated by Al-Bukhāri as reported by ‘Ā’ishah (may Allah be pleased with her)]<br> 2) The good deeds of a person are recorded for him, along with the resultant effects. This comes from the grace of Allah towards His servants.<br> 3) The Companions (may Allah be pleased with them) were keen to attend congregational prayers and live near the mosque, which shows their intent to hasten to do good deeds and reap the rewards. It behooves us to follow their example.
Related hadiths5
Compare isnād across 5 related chains →