Sayyiduna Ka'b bin Ujrah (may Allah be pleased with him) said: A man passed by the Prophet (peace and blessings be upon him), and the Companions of the Messenger of Allah (peace and blessings be upon him) (may Allah be pleased with them) saw his strength and vigour, so they said: "O Messenger of Allah, if only this were in the path of Allah!" The Messenger of Allah (peace and blessings be upon him) said: "If he has gone out to earn for his small children, he is in the path of Allah; if he has gone out to earn for his elderly parents, he is in the path of Allah; if he has gone out to earn for himself, to keep himself chaste (from begging), he is in the path of Allah; and if he has gone out for show and boasting, he is in the path of Satan."
Hadith Referenceالمعجم الكبير للطبراني / باب الكاف / 16332