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:17:60

And ˹remember, O Muhammad˺, when We told you, "Indeed, your Lord has encompassed the people." And We did not make the sight which We showed you except as a trial for the people, as was the accursed tree ˹mentioned˺ in the Qur'an. And We threaten them, but it increases them not except in great transgression.  

And, remember, when We said to you, ‘Truly your Lord encompasses mankind’, in knowledge and power ˹over them˺, such that they are within His grasp: so deliver the Message to them and do not fear anyone, because God will protect you from them. And We did not appoint the vision that We showed you, before your very eyes, during the Night Journey, except as a test for people, ˹for˺ the people of Mecca — since they denied it and some of them ˹even˺ apostatised when he ˹the Prophet˺ informed them of it — and ˹likewise˺ the tree cursed in the Qur’ān, namely, the ˹tree called˺ Zaqqūm ˹Q.37:62ff˺ that issues from the very root of the Blazing Fire ˹of Hell˺; We made it a test for them, because they said, ‘Fire consumes trees, so how can it cause it ˹the Zaqqūm tree˺ to issue forth?’. And We ˹seek to˺ deter them, with it, but it, Our deterrence, only increases them in gross insolence.
القرآن:١٧:٦٠

وَإِذْ قُلْنَا لَكَ إِنَّ رَبَّكَ أَحَاطَ بِالنَّاسِ ۚ وَمَا جَعَلْنَا الرُّؤْيَا الَّتِي أَرَيْنَاكَ إِلَّا فِتْنَةً لِلنَّاسِ وَالشَّجَرَةَ الْمَلْعُونَةَ فِي الْقُرْآنِ ۚ وَنُخَوِّفُهُمْ فَمَا يَزِيدُهُمْ إِلَّا طُغْيَانًا كَبِيرًا  

{و} اذكر {إذ قلنا لك إن ربك أحاط بالناس} علما وقدرة فهم في قبضته فبلّغهم ولا تخف أحدا فهو يعصمك منهم {وما جعلنا الرؤيا التي أريناك} عيانا ليلة الإسراء {إلا فتنة للناس} أهل مكة إذ كذبوا بها وارتد بعضهم لما أخبرهم بها {والشجرة الملعونة في القرآن} هي الزقوم التي تنبت في أصل الجحيم جعلناها فتنة لهم إذ قالوا: النار تحرق الشجر فكيف تنبته {ونخوفهم} بها {فما يزيدهم} تخويفنا {إلا طغيانا كبيرا}.