Joseph lived all his life confronting schemes made by the people closest to him. His brothers plotted to kill him, but they amended it to exiling him. This happened to him while he was a boy. He was sold into the slave market in Egypt, where he was bought for a nominal sum. Then he fell victim to the attempted seduction by a great man's wife who, when her wish was foiled, sent him to prison, where he remained for some time. In spite of all this, he at length approached close to the Egyptian throne and became the king's chief minister. He then began his call to Allah from the position of the ruling authority.
Allah's plans were carried out, and the matter ended. This is the substance (theme) of the story. As for the form (style) in which it is presented, it is a landmark of wonder.
Related Quran Ayaaths of this Hadith.
Surah 6 : Ayah 84 Surah 12 : Ayah 96 Surah 12 : Ayah 99 Surah 12 : Ayah 100 Surah 12 : Ayah 102 Surah 12 : Ayah 111"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari