Surah Yusuf

12:102

ذَٰلِكَ مِنْ أَنۢبَآءِ ٱلْغَيْبِ نُوحِيهِ إِلَيْكَ ۖ وَمَا كُنتَ لَدَيْهِمْ إِذْ أَجْمَعُوٓا۟ أَمْرَهُمْ وَهُمْ يَمْكُرُونَ

That is from the news of the unseen which We reveal, [O Muhammad], to you. And you were not with them when they put together their plan while they conspired.

Tafsir 12:102

Allah revealed all that has been mentioned from the story of Joseph and his brothers to the Messenger (peace be upon him). He had no knowledge of it beforehand, since he was not there with the brothers of Joseph when they agreed to throw him into the bottom of a well, and when they planned their trick; but Allah revealed this all to the Messenger (peace be upon him).