The Prophet ﷺ said, "When you place your dead in the grave, say, 'In the name of Allah and upon the religion of the Messenger of Allah ﷺ.'"
حدثنا يزيد أخبرنا همام بن يحيى عن قتادة عن أبي الصديق هو الناجي
عن النبي ﷺ قال إذا وضعتم موتاكم في القبر فقولوا بسم الله وعلى ملة رسول الله ﷺ
Its isnad is sahih. Al-Hakim narrated it (1:366) via Abdullah bin Raja and via Waki, both of them from Hammam, with this isnad, and he said, "A sahih hadith according to the criteria of the two Shaykhs, though they did not include it." Hammam bin Yahya is a reliable, trustworthy narrator, so when he narrates such a hadith with a connected chain, it cannot be faulted merely because of someone else, since Shubah narrated it as a stopped report, and Dhahabi concurred with him. Al-Hakim then narrated it via Shubah, from Qatada, from Abu Siddiq, from Ibn Umar, that whenever the deceased was placed in his grave, he would say, "In the name of Allah, and according to the sunnah of the Messenger of Allah."Abu Dawud also narrated it (3:206) via Hammam as well, with the wording that the Prophet, whenever the deceased was placed in the grave, would say, "In the name of Allah, and according to the sunnah of the Messenger of Allah," thus presenting it as a report of an action rather than of his words.His commentator quoted from Munziri, who said, "Nasai narrated it both traced to the Prophet and as a stopped report." This is a mistake on the part of Munziri, or of whoever quoted him, for Nasai did not narrate it in his Sunan. Rather, it was Tirmidhi who narrated it (2:152-153) via Hajjaj, from Nafi, from Ibn Umar, from the Messenger of Allah ﷺ, presenting it as a report of an action. Tirmidhi then said, "A hasan hadith, rare from this route." This hadith has also been narrated through a different route from Ibn Umar, from the Prophet, narrated by Abu Siddiq Naji, from Ibn Umar, from the Prophet. It has also been narrated from Abu Siddiq, from Ibn Umar, as a stopped report as well.Ibn Majah likewise narrated it (1:242) via Layth bin Abu Salim and Hajjaj, from Nafi, as a report of an action traced to the Prophet.All of this supports the soundness of the report traced to the Prophet given here, and confirms that it is sahih according to the criteria of the two Shaykhs, as al-Hakim said, and it is not harmed by the fact that some narrated it as a stopped report. It also confirms that Munziri, or whoever quoted him, made a mistake, since he attributed it to Nasai and did not attribute it to Tirmidhi and Ibn Majah.Among the things that support the correctness of what we have said is that it is mentioned in Muntaqa (1897), where it says, "The five narrated it except Nasai."