Anas bin Malik reported,

The Emigrants and the Helpers were digging the trench around Madinah, carrying the dirt on their backs while chanting,"We are the ones who pledged to Muhammad to remain upon Islam as long as we live."The Prophet ﷺ would reply to them,"O Allah, there is no good except the good of the Hereafter, so bless the Helpers and the Emigrants."He said, They would be brought a handful of barley, which was prepared for them with rancid fat and placed before the people. The people were starving, yet the food was foul to swallow and gave off a putrid smell.

Azami 8915

Sahih

عن أنس قال

جعل المهاجرون والأنصار يحفرون الخندق حول المدينة، وينقلون التراب على متونهم وهم يقولون: نحن الذين بايعوا محمدا على الإسلام ما بقينا أبدا قال: يقول النبي ﷺ وهو يجيبهم: اللهم إنه لا خير إلا خير الآخرة فبارك في الأنصار والمهاجرة قال: يؤتون بملء كفي من الشعير، فيصنع لهم بإهالة سنخة توضع بين يدي القوم، والقوم جياع، وهي بشعة في الحلق ولها ريح منتن.

الأعظمي 8915صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Expedition of Ahzab
Section
Prophet ﷺ ordering the digging of the trench around Madinah and encouraging his companions to do so
Numbering
Jami al-Kamil 8915 (2nd edition)
Azami 8915