فَاسْتَجَابَ لَهٗ رَبُّهٗ فَصَرَفَ عَنْهُ كَيْدَهُنَّ ۗاِنَّهٗ هُوَ السَّمِيْعُ الْعَلِيْمُ ( يوسف: ٣٤ )
Fastajaaba lahoo rabbuhoo fasarafa 'anhu kaidahunn; innahoo Huswas_Samee'ul 'Aleem (Yūsuf 12:34)
So his Lord responded to him and averted from him their plan. Indeed, He is the Hearing, the Knowing. (Yusuf  : 34)
1 Mufti Taqi Usmani
So, his Lord accepted his prayer and turned their guile away from him. Surely, He is the All-Hearing, the All-Knowing.