All perfect praise be to Allaah, The Lord of the worlds. I testify that there is none worthy of worship except Allaah and that Muhammad is His slave and Messenger.
At-Tabaraani reported in his three Ma’aajim (Al-Mu’jam Al-Kabeer, Al-Mu’jam Al-Awsat and Al-Mu’jam as-Sagheer) that Ka’b ibn ‘Ujrah narrated:
“A man passed by the Prophet and the Companions of the Prophet of Allaah saw his vigor and hard work. They said, 'O Messenger of Allaah, if only this was done in the cause of Allaah.' The Prophet said, 'If he goes out striving to provide for his young children, then it is in the cause of Allaah. If he goes out striving to provide for his elderly parents, then it is in the cause of Allaah. If he is striving in order to suffice himself against begging from others, then it is in the cause of Allaah. But if he goes out to show off and boast, then it is in the cause of Satan.'”
This hadeeth was graded as saheeh (sound) by Al-Albaani in Saheeh at-Targheeb wat-Tarheeb.
Allaah knows best.