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:12:78

They said, "O 'Azeez, indeed he has a father ˹who is˺ an old man, so take one of us in place of him. Indeed, we see you as a doer of good."  

They said, ‘O Court officer, lo! he has a father, an aged man, who loves him more than we do, and who finds solace in him from ˹the anguish he feels for˺ his dead son; and it will grieve him to part with him, so take one of us, enslave him, in his place, instead of him: indeed we see that you are among the virtuous’, in ˹terms of˺ your actions.
القرآن:١٢:٧٨

قَالُوا يَا أَيُّهَا الْعَزِيزُ إِنَّ لَهُ أَبًا شَيْخًا كَبِيرًا فَخُذْ أَحَدَنَا مَكَانَهُ ۖ إِنَّا نَرَاكَ مِنَ الْمُحْسِنِينَ  

{قالوا يا أيها العزيز إن له أبا شيخا كبيرا} يحبه أكثر منا ويتسلى به عن ولده الهالك ويحزنه ففراقه {فخذ أحدنا} استبعده {مكانه} بدلا منه {إنا نراك من المحسنين} في أفعالك.