Abdullah bin Amr bin As reported,

The Messenger of Allah ﷺ besieged the people of Taif but gained nothing from them, so he said, "We will be departing, Allah willing."His companions said, "Shall we leave without conquering it?"The Messenger of Allah ﷺ said to them, "Then go out tomorrow morning and fight."They went out the next morning to fight and sustained injuries. The Messenger of Allah ﷺ then said to them, "We will be departing tomorrow."This pleased them, and the Messenger of Allah ﷺ laughed.

Muslim 4620

Sahih

حدثنا أبو بكر بن أبي شيبة وزهير بن حرب وابن نمير جميعا عن سفيان قال زهير حدثنا سفيان بن عيينة عن عمرو عن أبي العباس الشاعر الأعمى

عن عبد الله بن عمرو قال

حاصر رسول الله ﷺ أهل الطائف فلم ينل منهم شيئا فقال إنا قافلون إن شاء الله قال أصحابه نرجع ولم نفتتحه فقال لهم رسول الله ﷺ اغدوا على القتال فغدوا عليه فأصابهم جراح فقال لهم رسول الله ﷺ إنا قافلون غدا قال فأعجبهم ذلك فضحك رسول الله ﷺ

مسلم 4620صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Jihad and expeditions
Chapter
Expedition of Taif
Numbering
Darussalam 4620
Muslim 4620