Sunan Ibn Majah 976
سنن ابن ماجه#976SahihIt was narrated that Abu Mas’ud Al-Ansari said:“The Messenger of Allah (ﷺ) used to gently pat our shoulders (to make sure the row was straight) at the time of prayer, saying: ‘Keep (the rows) straight, do not differ from one another lest your hearts should suffer from discord. Let those who are forbearing and wise stand closest to me, then those who are next to them, then those who are next to them.’”
Scholarly Authentication
We show the most cautious grade (weakest-wins) as the overall label. Individual scholars graded it as follows:
Al-AlbaniSahih
Muhammad Fouad Abd al-BaqiSahih
Shuaib Al ArnautSahih
Zubair Ali ZaiSahih Muslim
In-book reference: 5:174