Suhayb reported,

While the Messenger of Allah ﷺ was sitting with his companions, he laughed. He said, "Will you not ask me what made me laugh?"They said, "Messenger of Allah, what made you laugh?"He replied, "I marvel at the affair of the believer. All of his affairs are good for him. If something he loves befalls him, he praises Allah, and that is good for him. If something he dislikes befalls him and he endures it patiently, that too is good for him. No one's entire affair is good for him except the believer."My father said, Affan also narrated it to us, saying, Sulayman narrated to us, Thabit narrated to us, with this exact wording. I think this is a mistake. This is the wording of Hammad. Sulayman narrated to us, saying, Thabit narrated to us, with wording similar to that of Abdul-Rahman from Sulayman, and that was from his book which he read out to us.

Ahmad 23930

Sahih

حدثنا عفان حدثنا حماد بن سلمة حدثنا ثابت عن عبد الرحمن بن أبي ليلى

عن صهيب قال

بينا رسول الله ﷺ قاعد مع أصحابه إذ ضحك فقال ألا تسألوني مم أضحك قالوا يا رسول الله ومم تضحك قال عجبت لأمر المؤمن إن أمره كله خير إن أصابه ما يحب حمد الله وكان له خير وإن أصابه ما يكره فصبر كان له خير وليس كل أحد أمره كله له خير إلا المؤمن قال أبي و حدثناه عفان أيضا حدثناه سليمان حدثنا ثابت هذا اللفظ بعينه وأراه وهم هذا لفظ حماد وقد حدثنا قال سليمان حدثنا ثابت نحوا من لفظ عبد الرحمن عن سليمان وذلك من كتابه قرأه علينا

أحمد 23930صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Suhayb
Numbering
Darussalam 23930
Ahmad 23930