‘Ali ibn Ibrahim narrates that Archangel Gabriel told Yusuf to extend his hand. When he did so, a light escaped from between his fingers. Yusuf asked what that was. Archangel Gabriel said it was the light of Prophethood. “The Almighty has removed Prophethood from your loins because you did not arise from your seat to respect your father (when he entered).” Allah removed Prophethood from Yusuf (as..) so that none of his descendants may be conferred Messengership. The Prophethood was transferred to the loins of Lawi, the elder brother of Yusuf. He became eligible for this honor because when the brothers had plotted to kill Yusuf he suggested pushing him in the well instead of murdering him.
As Lawi had prevented the murder of Yusuf, the Almighty placed Prophethood in his loins. Secondly when Benjamin was arrested and despite their efforts the brothers failed to secure his release and prepared to return to Ya‘qub. Lawi said he would not leave Egypt until his father permitted or until Almighty, “decides for me, and He is the best of the judges.”
Allah liked this gesture and Prophethood was transferred to his progeny. Consequently the series of The Israelites Prophets were descendants of Lawi. Musa was also from his progeny. He was the son of ‘Imran, son of Baseer, son of Fahith son of Lawi.