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.
quran:3:166

And what struck you on the day the two armies met was by permission of Allah that He might make evident the ˹true˺ believers.  

And what afflicted you, the day the two hosts encountered, at Uhud, was by God’s leave, by His will, and that He might know, through knowledge manifested outwardly, the, true, believers.
القرآن:٣:١٦٦

وَمَا أَصَابَكُمْ يَوْمَ الْتَقَى الْجَمْعَانِ فَبِإِذْنِ اللَّهِ وَلِيَعْلَمَ الْمُؤْمِنِينَ  

{وما أصابكم يوم التقى الجمعان} بأحد {فبإذن الله} بإرادته {وليعلم} علم ظهور {المؤمنين} حقا.