Anas bin Malik reported,

The Emigrants and the Helpers began digging the trench around Medina, carrying the earth on their backs, chanting,"We are the ones who pledged to Muhammad To uphold Islam as long as we live."The Prophet ﷺ would respond to them, saying,"O Allah, there is no good except the good of the Hereafter, So bless the Helpers and the Emigrants."

Bukhari 2835

Sahih

حدثنا أبو معمر حدثنا عبد الوارث حدثنا عبد العزيز

عن أنس رضي الله عنه قال

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

البخاري 2835صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Jihad and expeditions
Chapter
Digging the trench
Numbering
Darussalam 2835
Bukhari 2835