Mishkat al-Masabih 1707
وَعَنِ ابْنِ عُمَرَ أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ كَانَ إِذَا أَدْخَلَ الْمَيِّتَ الْقَبْرَ قَالَ: «بِسم الله وَبِاللَّهِ وعَلى مِلَّةِ رَسُولِ اللَّهِ» . وَفِي رِوَايَةٍ: وَعَلَى سُنَّةِ رَسُولِ اللَّهِ. رَوَاهُ أَحْمَدُ وَالتِّرْمِذِيُّ وَابْنُ مَاجَهْ وَرَوَى أَبُو دَاوُد الثَّانِيَة
From Ibn ʿUmar: When the Prophet ﷺ placed the deceased in the grave, he would say: "In the name of Allah, and by Allah, and upon the religion of the Messenger of Allah." In a narration: and upon the Sunnah of the Messenger of Allah. Reported by Ahmad, at-Tirmidhi and Ibn Majah, and Abu Dawud reported the second.