Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:20:39

˹Saying˺, 'Cast him into the chest and cast it into the river, and the river will throw it onto the bank; there will take him an enemy to Me and an enemy to him.' And I bestowed upon you love from Me that you would be brought up under My eye.  

“Cast him, place him, in the ark, then cast him, ˹while˺ in the ark, into the river, ˹into˺ the flow of the Nile, and then the river shall throw him up onto the shore, that is, its bank (the imperative here ˹fa’l-yulqihi, ‘let it throw him’˺ functions as a predicate); ˹there˺ an enemy of Mine and an enemy of his, namely, Pharaoh, shall take him”. And, after he took you, I cast upon you love from Me, that you may be loved by people; and indeed Pharaoh, and all who saw you, loved you; and that you might be reared under My eyes, be nurtured under My guardianship and My protection of you.
القرآن:٢٠:٣٩

أَنِ اقْذِفِيهِ فِي التَّابُوتِ فَاقْذِفِيهِ فِي الْيَمِّ فَلْيُلْقِهِ الْيَمُّ بِالسَّاحِلِ يَأْخُذْهُ عَدُوٌّ لِي وَعَدُوٌّ لَهُ ۚ وَأَلْقَيْتُ عَلَيْكَ مَحَبَّةً مِنِّي وَلِتُصْنَعَ عَلَىٰ عَيْنِي  

{أن اقذفيه} ألقيه {في التابوت فاقذفيه} بالتابوت {في اليم} بحر النيل {فلْيُلقه اليم بالساحل} أي شاطئه والأمر بمعنى الخبر {يأخذه عدو لي وعدو له} وهو فرعون {وألقيت} بعد أن أخذك {عليك محبة مني} لتحب في الناس فأحبك فرعون وكل من رآك {ولتُصنع على عيني} تربى على رعايتي وحفظي لك.