Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
ibnmajah:2600Muḥammad b. Rumḥ > ʿAbdullāh b. Lahīʿah > Muḥammad b. ʿAjlān > ʿAmr b. Shuʿayb from his father from his grandfather

the Messenger of Allah ﷺ forbade lashing for the legal punishment in the mosques.  

ابن ماجة:٢٦٠٠حَدَّثَنَا مُحَمَّدُ بْنُ رُمْحٍ أَنْبَأَنَا عَبْدُ اللَّهِ بْنُ لَهِيعَةَ عَنْ مُحَمَّدِ بْنِ عَجْلاَنَ أَنَّهُ سَمِعَ عَمْرَو بْنَ شُعَيْبٍ يُحَدِّثُ عَنْ أَبِيهِ عَنْ جَدِّهِ

أَنَّ رَسُولَ اللَّهِ ﷺ نَهَى عَنْ جَلْدِ الْحَدِّ فِي الْمَسَاجِدِ