What a planted thing keeps earning
It does not specify who eats.
مَا مِنْ مُسْلِمٍ غَرَسَ غَرْسًا فَأَكَلَ مِنْهُ إِنْسَانٌ أَوْ دَابَّةٌ إِلاَّ كَانَ لَهُ صَدَقَةً
Mā min muslimin gharasa gharsan fa-akala minhu insānun aw dābbatun illā kāna lahu ṣadaqah
There is no Muslim who plants a plant, and a human being or an animal eats from it, but that it is charity for him.
Where this comes from
No intention is required at the moment of eating, and the eater does not have to be known or deserving or human. The act was finished years earlier.
The full narration
Narrated Anas bin Malik:The Prophet (ﷺ) said, "If any Muslim plants any plant and a human being or an animal eats of it, he will be rewarded as if he had given that much in charity
Source
Ṣaḥīḥ al-Bukhārī · 6012
Ṣaḥīḥ
- Agreed upon as authentic (al-Bukhārī / Muslim)