Anas bin Malik reported,

The companions of the Prophet ﷺ used to chant while digging the trench, "We are the ones who pledged allegiance to Muhammad upon Islam, as long as we live, forever."The Prophet ﷺ would respond, "Allah, there is no good except the good of the Hereafter, so forgive the Ansar and the Muhajirin."Some barley bread topped with rancid fat was brought to the Messenger of Allah ﷺ, and they ate from it. The Prophet ﷺ said, "Indeed, the only true good is the good of the Hereafter."

Ahmad 13646

Sahih

حدثنا عفان حدثنا حماد قال أخبرنا ثابت

عن أنس

أن أصحاب النبي ﷺ كانوا يقولون وهم يحفرون الخندق نحن الذين بايعوا محمدا على الإسلام ما بقينا أبدا والنبي ﷺ يقول اللهم إن الخير خير الآخره فاغفر للأنصار والمهاجره وأتي رسول الله ﷺ بخبز شعير عليه إهالة سنخة فأكلوا منها وقال النبي ﷺ إنما الخير خير الآخره

أحمد 13646صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 13646
Ahmad 13646