Anas bin Malik reported,

The tribe of Banu Salama wanted to move closer to the mosque, but the Messenger of Allah ﷺ disliked that the outskirts of Madinah be left empty.He said, "Banu Salama, will you not count your footsteps as a reward with Allah?"So they stayed where they were.

Azami 10640

Sahih

عن أنس قال

أراد بنو سلمة أن يتحولوا إلى قرب المسجد، فكره رسول الله ﷺ أن تعرى المدينة وقال: يا بني سلمة: ألا تحتسبون آثاركم فأقاموا.

الأعظمي 10640صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Virtues of the lands
Chapter
Virtue of the Prophet's Madinah
Section
Prophet's ﷺ dislike of Madinah being left unguarded
Numbering
Jami al-Kamil 10640 (2nd edition)
Azami 10640