Anas bin Malik reported,

The Prophet ﷺ said, "Whoever sees me in a dream has truly seen me, for Satan cannot take my form. The dream of a believer is one of forty-six parts of prophethood."In another wording, "A good dream from a righteous man is one of forty-six parts of prophethood."

Azami 11668

Sahih

عن أنس بن مالك قال

قال النبي ﷺ: من رآني في المنام فقد رآني، فإن الشيطان لا يتمثل بي، ورؤيا المؤمن جزء من ستة وأربعين جزءا من النبوة وفي لفظ: الرؤيا الحسنة من الرجل الصالح جزء من ستة وأربعين جزءا من النبوة

الأعظمي 11668صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Dreams and their interpretation
Chapter
Medicine
Section
Righteous dream is from the glad tidings, and it is a part of prophethood
Numbering
Jami al-Kamil 11668 (2nd edition)
Azami 11668