حَدَّثَنَا عَبْدُ اللَّهِ بْنُ مُحَمَّدٍ النُّفَيْلِيُّ، حَدَّثَنَا زُهَيْرٌ، حَدَّثَنَا سُلَيْمَانُ التَّيْمِيُّ، أَنَّ أَبَا عُثْمَانَ، حَدَّثَهُ عَنْ أُبَىِّ بْنِ كَعْبٍ، قَالَ كَانَ رَجُلٌ لاَ أَعْلَمُ أَحَدًا مِنَ النَّاسِ مِمَّنْ يُصَلِّي الْقِبْلَةَ مِنْ أَهْلِ الْمَدِينَةِ أَبْعَدَ مَنْزِلاً مِنَ الْمَسْجِدِ مِنْ ذَلِكَ الرَّجُلِ وَكَانَ لاَ تُخْطِئُهُ صَلاَةٌ فِي الْمَسْجِدِ فَقُلْتُ لَوِ اشْتَرَيْتَ حِمَارًا تَرْكَبُهُ فِي الرَّمْضَاءِ وَالظُّلْمَةِ ‏.‏ فَقَالَ مَا أُحِبُّ أَنَّ مَنْزِلِي إِلَى جَنْبِ الْمَسْجِدِ فَنُمِيَ الْحَدِيثُ إِلَى رَسُولِ اللَّهِ صلى الله عليه وسلم فَسَأَلَهُ عَنْ قَوْلِهِ ذَلِكَ فَقَالَ أَرَدْتُ يَا رَسُولَ اللَّهِ أَنْ يُكْتَبَ لِي إِقْبَالِي إِلَى الْمَسْجِدِ وَرُجُوعِي إِلَى أَهْلِي إِذَا رَجَعْتُ ‏.‏ فَقَالَ ‏"‏أَعْطَاكَ اللَّهُ ذَلِكَ كُلَّهُ أَنْطَاكَ اللَّهُ جَلَّ وَعَزَّ مَا احْتَسَبْتَ كُلَّهُ أَجْمَعَ ‏"
Translation
Ubayy b. Ka’b said

Ubayy ibn Ka'b reported: There was a man—and I do not know of anyone among the people who pray facing the qiblah from the people of Madinah whose dwelling was farther from the mosque than that man—and he never missed a prayer in the mosque. So I said to him, "If only you bought a donkey to ride on it during the heat and in the darkness!" He said, "I would not love for my house to be next to the mosque." The matter was mentioned to the Messenger of Allah (ﷺ), so he asked him about his saying that. He said, "O Messenger of Allah, I intended that my walking to the mosque and my return to my family when I return should be recorded for me." He said, "Allah has granted you all of that; Allah, the Mighty and Majestic, has granted you all that you reckoned for reward."