Sahih al-Bukhari — Witnesses — Hadith No: 2642
Translation
Narrated Anas:A funeral procession passed in front of the Prophet (ﷺ) and the people praised the deceased. The Prophet (ﷺ) said, "It has been affirmed (Paradise)." Then another funeral procession passed by and the people talked badly of the deceased. The Prophet (ﷺ) said, "It has been affirmed (Hell)." Allah's Messenger (ﷺ) was asked, "O Allah's Messenger (ﷺ)! You said it has been affirmed for both?" The Prophet (ﷺ) said, "The testimony of the people (is accepted), (for) the believers are Allah's witnesses on the earth