Qur'an 12:22
وَلَمَّا بَلَغَ أَشُدَّهُۥٓ ءَاتَيْنَـٰهُ حُكْمًا وَعِلْمًا ۚ وَكَذَٰلِكَ نَجْزِى ٱلْمُحْسِنِينَ
“And when he [i.e., Joseph] reached maturity, We gave him judgement and knowledge. And thus We reward the doers of good.”
Yusuf 12:22 · Saheeh International