It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "Indeed, messengership and prophethood have come to an end, so there is no messenger after me and no prophet." Anas (may Allah be pleased with him) said: This was hard on the people. So he (peace and blessings be upon him) said: "But the glad tidings (al-mubashshirat) remain." The people said: "O Messenger of Allah, what are the glad tidings?" He (peace and blessings be upon him) said: "The (true) dream of a Muslim man, and it is one of the parts of prophethood."
This wording is that of Imam Ahmad bin Hanbal (may Allah have mercy on him).
And in the narration of Zuhayr (may Allah have mercy on him), the Messenger of Allah (peace and blessings be upon him) said: "Messengership" and he said: "the dream of a Muslim"; he did not say the word "man", and the rest of the narration is like it.
Imam al-Tirmidhi (may Allah have mercy on him) narrated it through al-Hasan bin Muhammad al-Za'farani (may Allah have mercy on him) from Affan (may Allah have mercy on him), and said: "This hadith is sahih gharib from the narration of al-Mukhtar."