From Sahih Bukhari (Hadith 1432):
Narrated Abu Burda bin Abu Musa:that his father said, "Whenever a beggar came to Allah's Messenger (ﷺ) or he was asked for something, he used to say (to his companions), "Help and recommend him and you will receive the reward for it; and Allah will bring about what He will through His Prophet's tongue
Reference: Bukhari 1432