The Prophet ﷺ said, "When a Muslim spends on his family seeking reward from Allah, it counts as charity for him."
حدثنا عفان حدثنا شعبة قال عدي بن ثابت أخبرني قال سمعت عبد الله بن يزيد يحدث
عن النبي ﷺ قال عن النبي ﷺ قال إن المسلم إذا أنفق على أهله نفقة وهو يحتسبها كانت له صدقة
Its chain of transmission is sahih. Abdullah bin Yazid is Ibn Zayd bin Husayn the Ansari, the Khatmi, a companion who had seen the Prophet and who governed Kufa in the days of Ibn Zubayr.The hadith was narrated by Bukhari, 5/107, Shab edition, in the Book of Military Expeditions, chapter on the Battle of Badr, and by Muslim, 2/695, number 1002, in the Book of Zakat, chapter on the merit of spending and charity, and by Tirmidhi, 4/344, number 1965, who said it is hasan sahih, and by Nasai, 5/69, number 2545.