So he [Yusuf (Joseph)] began (the search) in their bags before the bag of his brother. Then he brought it out of his brother's bag. Thus did We plan for Yusuf (Joseph). He could not take his brother by the law of the king (as a slave), except that Allah willed it. (So Allah made the brothers to bind themselves with their way of "punishment, i.e. enslaving of a thief.") We raise to degrees whom We please, but over all those endowed with knowledge is the All-Knowing (Allah).