Sunan Ibn Majah, Volume 5, Book 37, Hadith 4226 (DarusSalam) ⓘ
It was narrated that Abu Hurairah said: “A man said: ‘O Messenger of Allah, I do a good deed, then others find out about it and that pleases me.’ He said: ‘You will have two rewards, the reward for doing it in secret and the reward for doing it openly (so that others may follow your example).’”
حَدَّثَنَا مُحَمَّدُ بْنُ بَشَّارٍ، حَدَّثَنَا أَبُو دَاوُدَ، حَدَّثَنَا سَعِيدُ بْنُ سِنَانٍ أَبُو سِنَانٍ الشَّيْبَانِيُّ، عَنْ حَبِيبِ بْنِ أَبِي ثَابِتٍ، عَنْ أَبِي صَالِحٍ، عَنْ أَبِي هُرَيْرَةَ، قَالَ قَالَ رَجُلٌ : يَا رَسُولَ اللَّهِ إِنِّي أَعْمَلُ الْعَمَلَ فَيُطَّلَعُ عَلَيْهِ فَيُعْجِبُنِي قَالَ : " لَكَ أَجْرَانِ : أَجْرُ السِّرِّ وَأَجْرُ الْعَلاَنِيَةِ " .
also referenced under: Hadith 4226 (Reference) & Book 37, Hadith 4366 (In-Book)