Narrated 'Abdullah bin 'Abbas: Once solar eclipse occurred during the lifetime of Allah's Messenger ﷺ. He offered the eclipse prayer. His companions asked, "O Allah's Messenger ﷺ! We saw you trying to take something while standing at your place and then we saw you retreating". The Prophet ﷺ said, "I was shown Paradise and wanted to have a bunch of fruit from it. Had I taken it, you would have eaten from it as long as the world remains".
The Prophet Muhammad ﷺ also taught his companions an important lesson through this hadith; if he had taken the fruit, they would have been able to eat it as long as the world remains. This shows how generous Allah is with His rewards for those who obey Him and follow His teachings. We should strive to do good deeds in order to receive such blessings from Allah in both worlds - this one and the hereafter.