The Messenger of Allah ﷺ said, "I am closer to the believers than they are to themselves. Whoever dies leaving wealth, his wealth goes to his paternal heirs, and whoever leaves behind dependents or those in need, I am their guardian, so let them be referred to me."
قال رسول الله ﷺ: أنا أولى بالمؤمنين من أنفسهم، فمن مات وترك مالا فماله لموالي العصبة، ومن ترك كلا أو ضياعا فأنا وليه فلأدعى له.
Bukhari related it in the Book of Inheritance Shares (6745), from Mahmud, who said, Ubaydullah told us, from Israil, from Abu Husayn, from Abu Salih, from Abu Hurairah, and he narrated it.His saying "diyaa" means someone left destitute, who has nothing, so I take care of him and spend on him.