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:8:47

And do not be like those who came forth from their homes insolently and to be seen by people and avert ˹them˺ from the way of Allah. And Allah is encompassing of what they do.  

And do not be like those who went forth from their dwellings, to defend their caravan and but did not return after it had passed safely, in recklessness and to show off to men — when they said, ‘We will not return until we have drunk wine, sacrificed the camels, and have been entertained by singers at Badr, and ˹until˺ people have heard about this — barring, people, from the way of God, while God encompasses, in knowledge, what they do (ya‘malūna, also read ta‘malūna, ‘you do’), and will requite them for it.
القرآن:٨:٤٧

وَلَا تَكُونُوا كَالَّذِينَ خَرَجُوا مِنْ دِيَارِهِمْ بَطَرًا وَرِئَاءَ النَّاسِ وَيَصُدُّونَ عَنْ سَبِيلِ اللَّهِ ۚ وَاللَّهُ بِمَا يَعْمَلُونَ مُحِيطٌ  

{ولا تكونوا كالذين خرجوا من ديارهم} ليمنعوا غيرهم ولم يرجعوا بعد نجاتها {بطرا ورئاء الناس} حيث قالوا لا نرجع حتى نشرب الخمر وننحر الجزور وتضرب علينا القيان ببدر فيتسامع بذلك الناس {ويصدون} الناس {عن سبيل الله والله بما يعملون} بالياء والتاء {محيط} علما فيجازيهم به.