It is narrated from Sayyiduna Ubadah bin al-Samit (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) was asked about this saying of Allah Almighty: "For them are glad tidings in the life of this world and in the Hereafter", and he (peace and blessings be upon him) said: "It refers to the righteous dream that a believer sees himself or that is shown to him."
Isma'il bin Ayyash (may Allah have mercy on him) also narrated this hadith from Safwan bin Amr (may Allah have mercy on him), from Humayd bin Abdullah (may Allah have mercy on him).