Dalil

Quran Muhammad 47:21

طَاعَةٞ وَقَوۡلٞ مَّعۡرُوفٞۚ فَإِذَا عَزَمَ ٱلۡأَمۡرُ فَلَوۡ صَدَقُواْ ٱللَّهَ لَكَانَ خَيۡرٗا لَّهُمۡ

Translation

Obedience and good words. And when the matter [of fighting] was determined, if they had been true to Allāh, it would have been better for them.