Shaybi reported,

The Messenger of Allah ﷺ prayed over a grave after the deceased had been buried, saying four takbirs over it.Shaybani said, I asked Shabi, "Who narrated this to you?"He replied, "A trustworthy person, Abdullah bin Abbas."This is the wording of Hasan's narration. In the narration of Ibn Numayr, he said, The Messenger of Allah ﷺ came upon a fresh grave and prayed over it. The people lined up in rows behind him, and he made four takbirs.I asked Amir, "Who narrated this to you?"He answered, "A trustworthy person who witnessed it, Ibn Abbas."

Muslim 2211

Sahih

حدثنا حسن بن الربيع ومحمد بن عبد الله بن نمير قالا حدثنا عبد الله بن إدريس عن الشيباني

عن الشعبي

أن رسول الله ﷺ صلى على قبر بعد ما دفن فكبر عليه أربعا قال الشيباني فقلت للشعبي من حدثك بهذا قال الثقة عبد الله بن عباس هذا لفظ حديث حسن وفي رواية ابن نمير قال انتهى رسول الله ﷺ إلى قبر رطب فصلى عليه وصفوا خلفه وكبر أربعا قلت لعامر من حدثك قال الثقة من شهده ابن عباس

مسلم 2211صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Funerals
Chapter
Prayer over the grave
Numbering
Darussalam 2211
Muslim 2211