It was narrated from Muadah bin Jabal that the Messenger of Allah said:
Military campaigns are of two types: as for the one who seeks the Face of Allah, obeys the imam, spends what is precious and avoids mischief, whether he is asleep or awake, he is earning reward. But as for the one who fights in order to show off and gain a reputation, and disobeys the imam and spreads mischief in the land, he comes back empty-handed. (Da 'if)