Allah narrated to Muhammad ﷺ, the story of Yusuf and his brothers and how Allah raised him over them, giving him the better end, triumph, the sovereignty and wisdom (i.e., prophethood), even though they tried to harm and kill him. Allah said, `This and similar stories are part of the unseen incidents of the past, O Muhammad,
نُوحِيهِ إِلَيْكَ
(which We reveal to you.) and inform you of, O Muhammad, because it carries a lesson, for you to draw from and a reminder to those who defy you.' Allah said next,
وَمَا كُنتَ لَدَيْهِمْ
`(You were not (present) with them), you did not witness their conference nor saw them,
After a full description of the story of Sayyidna Yusuf (علیہ السلام) ، first to come in the verses cited above is an address to the Holy Prophet ﷺ : ذَٰلِكَ مِنْ أَنبَاءِ الْغَيْبِ نُوحِيهِ إِلَيْكَ (That is a part of the reports of the unseen We reveal to you), and that ` you were not there with the brothers of Yusuf (علیہ السلام) when they had decided to throw Sayyidna Yusuf (علیہ السلام) into the well and were making plans for it.
The purpose of choosing to say this is that the very act of the Holy Prophet ﷺ in describing this story of Sayyidna Yusuf (علیہ السلام) correctly and in full details is a clear proof of his being a prophet and recipient of revelation. The reason is that this story dates back to thousands of years before his time. Neither was he present there on the scene to have described it as an eye witness, nor was he ever taught by anyone to have consulted books of history, or heard it from a teacher and described it. Therefore, there is no way he could have known it in the manner he did except that it be Divine revelation itself.
The one who rejects the truth looks at everything from the point of view of the human being, while a believer looks at everything in relation to God. Joseph received a high administrative post and he ascribed it to God’s generosity. He had the ability to interpret dreams but said that God had taught him all he knew. His own near and dear ones caused him trouble; even then he looked at this from the point of view that these were subtle devices of God by means of which He planned his intellectual and spiritual development. His sense of the majesty of God had obliterated all feelings of personal superiority. Even on reaching the zenith of worldly glory, he uttered these words, ‘O, God! Your being is all-powerful. It is You who fulfill all my needs. Kindly help me in the world as well as in the Hereafter. Include me among those people who have had the inspiration to submit to Your will in the world and in the Hereafter and are worthy of Your eternal reward.’
Uthmani text of the Madinah mushaf (King Fahd Complex). Translation: Saheeh International. Tafsir via Quran.com.