كتاب الحج
15  
The Book of Pilgrimage
(86)
Chapter: Encouragement to live in Al-Madinah and to be patient on bearing its distress and hardships
(86)
باب التَّرْغِيبِ فِي سُكْنَى الْمَدِينَةِ وَالصَّبْرِ عَلَى لأْوَائِهَا ‏‏
Sahih Muslim 1377 c

Abdullah b. 'Umar (Allah be pleased with them) said:

I heard Allah's Messenger (ﷺ) as saying: He who patiently endured the hardships and rigours of (this city, i. e. Medina), I would be his witness and intercessor on the Day of Resurrection.
وَحَدَّثَنَا ابْنُ رَافِعٍ، حَدَّثَنَا ابْنُ أَبِي فُدَيْكٍ، أَخْبَرَنَا الضَّحَّاكُ، عَنْ قَطَنٍ الْخُزَاعِيِّ، عَنْ يُحَنِّسَ، مَوْلَى مُصْعَبٍ عَنْ عَبْدِ اللَّهِ بْنِ عُمَرَ، قَالَ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏ "‏ مَنْ صَبَرَ عَلَى لأْوَائِهَا وَشِدَّتِهَا كُنْتُ لَهُ شَهِيدًا أَوْ شَفِيعًا يَوْمَ الْقِيَامَةِ ‏"‏ ‏.‏ يَعْنِي الْمَدِينَةَ ‏.‏
Reference : Sahih Muslim 1377c
In-book reference : Book 15, Hadith 550
USC-MSA web (English) reference : Book 7, Hadith 3182
  (deprecated numbering scheme)