ذِكْرُ الْأَمْرِ بِسُؤَالِ اللَّهِ جَلَّ وَعَلَا مِنْ فَضْلِهِ لِلْخَارِجِ مِنَ الْمَسْجِدِ
"I heard Abu Humaid and Abu Usaid say: 'The Messenger of Allah ﷺ said: "When any one of you enters the Masjid, let him say: 'Allahumma aftahli abwaba rahmatik (O Allah, open to me the gates of your mercy). And when he leaves let him say: Allahumma inni as'aluka min fadlik (O Allah, I ask You of Your bounty).'" (Using translation from Nasāʾī 729)
قَالَ رَسُولُ اللَّهِ ﷺ «إِذَا جَاءَ أَحَدُكُمْ إِلَى الْمَسْجِدِ فَلْيَقُلِ اللَّهُمَّ افْتَحْ لِي أَبْوَابَ رَحْمَتِكَ وَإِذَا خَرَجَ فَلْيَقُلِ اللَّهُمَّ إِنِّي أَسْأَلُكَ مِنْ فَضْلِكَ»