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:59:7

And what Allah restored to His Messenger from the people of the towns - it is for Allah and for the Messenger and for ˹his˺ near relatives and orphans and the ˹stranded˺ traveler - so that it will not be a perpetual distribution among the rich from among you. And whatever the Messenger has given you - take; and what he has forbidden you - refrain from. And fear Allah; indeed, Allah is severe in penalty.  

Whatever spoils God has given to His Messenger from the people of the towns, such as al-Safrā’, Wādī alQurā and Yanbu‘, belong to God, dispensing with it as He will, and to the Messenger and to the near of kin, the Prophet’s kin, from among the Banū Hāshim and the Banū al-Muttālib, and the orphans, the ˹orphaned˺ children of Muslims, those whose parents have died and who are impoverished, and the needy, those Muslims in need, and the traveller, the Muslim who may be cut off ˹from all resources˺ on a remote journey: in other words, they ˹these spoils˺ are the due of the Prophet (s) and ˹those of˺ the four categories, divided up in the way that he used to, where each category received a fifth of the fifth, with the rest being his ˹the Prophet’s˺, so that these, the spoils — this being the justification for the division of these ˹spoils˺ in this way, do not (kay-lā: kay functions like lā with a following implied an ˹sc. an-lā˺) become a thing circulating, handed round, between the rich among you. And whatever the Messenger gives you, of spoils or otherwise, take it; and whatever he forbids you, abstain ˹from it˺. And fear God. Surely God is severe in retribution.
القرآن:٥٩:٧

مَا أَفَاءَ اللَّهُ عَلَىٰ رَسُولِهِ مِنْ أَهْلِ الْقُرَىٰ فَلِلَّهِ وَلِلرَّسُولِ وَلِذِي الْقُرْبَىٰ وَالْيَتَامَىٰ وَالْمَسَاكِينِ وَابْنِ السَّبِيلِ كَيْ لَا يَكُونَ دُولَةً بَيْنَ الْأَغْنِيَاءِ مِنْكُمْ ۚ وَمَا آتَاكُمُ الرَّسُولُ فَخُذُوهُ وَمَا نَهَاكُمْ عَنْهُ فَانْتَهُوا ۚ وَاتَّقُوا اللَّهَ ۖ إِنَّ اللَّهَ شَدِيدُ الْعِقَابِ  

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