Joseph is made guardian of the storehouses of Egypt by the king 12:54-57
12:54 The king said, 'Bring him Joseph) before me. I will assign him to myself.' And when he had spoken with him he said, 'Today, you are firmly established in both our favor and trust.'
Allah never wastes the wage of the righteous 12:56-57
12:56 And as such We established Joseph in the land to live wherever he liked. We bestow Our Mercy on whom We will, and We never waste the wage of the righteous.