Kaab bin Malik reported,

ﷺ said, "I never stayed behind from any expedition that the Messenger of Allah ﷺ led, except for the expedition of Tabuk, though I had also stayed behind from the expedition of Badr. But no one was reproached for staying behind from Badr, since the Messenger of Allah ﷺ had only set out seeking the caravan of Quraysh, until Allah brought them and their enemy together without a prior appointment."

Azami 12396

Sahih

عن كعب بن مالك

ﷺ قال: لم أتخلف عن رسول الله ﷺ في غزوة غزاها إلا فى غزوة تبوك، غير أنى تخلفت عن غزوة بدر، ولم يعاتب أحد تخلف عنها، إنما خرج رسول الله ﷺ يريد عير قريش، حتى جمع الله بينهم وبين عدوهم على غير ميعاد.

الأعظمي 12396صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Tafsir of the great Quran
Chapter
Virtues of Surah Baqarah
Section
His saying, "When you were on the near side and they were on the far side, and the caravan was below you. And if you had made an appointment, you would have failed to keep the appointment. But that Allah might accomplish a matter already destined, that he who perished would perish upon clear evidence, and he who lived would live upon clear evidence. And indeed, Allah is Hearing, Knowing"
Numbering
Jami al-Kamil 12396 (2nd edition)
Azami 12396