Hadith 1116:7
'Affan narrated to us, Hammad ibn Salamah narrated to us, Thabit narrated to us, from 'Abd al-Rahman ibn Abi Layla, from Suhayb, who said: While the Messenger of Allah (peace and blessings of Allah be upon him) was sitting with his companions, he laughed. He said: "Will you not ask me what I am laughing at?" They said: "O Messenger of Allah, what are you laughing at?" He said: "I am amazed at the affair of the believer; indeed, his entire affair is good. If he is afflicted with what he loves, he praises Allah and it is good for him. And if he is afflicted with what he dislikes, he is patient, and it is good for him. And not everyone’s affair is entirely good for him except the believer." 'Affan also narrated it to us, Sulayman narrated to us, Thabit narrated to us, with this exact wording, and I think he was mistaken; this is the wording of Hammad. And he narrated it to us, saying: Sulayman narrated to us, Thabit narrated to us, similar to the wording of 'Abd al-Rahman, from Sulayman, and that was from his book, read to us.
حدثنا عفان، حدثنا حماد بن سلمة، حدثنا ثابت، عن عبد الرحمن بن أبي ليلى، عن صهيب، قال: بينا رسول الله صلى الله عليه وسلم قاعد مع أصحابه إذ ضحك فقال: " ألا تسألوني مم أضحك؟ " قالوا: يا رسول الله، ومم تضحك؟ قال: " عجبت لأمر المؤمن، إن أمره كله خير، إن أصابه ما يحب، حمد الله وكان له خير، وإن أصابه ما يكره فصبر، كان له خير، وليس كل أحد أمره كله له خير إلا المؤمن " وحدثناه عفان، أيضا، حدثنا سليمان، حدثنا ثابت، هذا اللفظ بعينه وأراه وهم هذا لفظ حماد، وقد حدثنا به قال: حدثنا سليمان، حدثنا ثابت، نحوا من لفظ عبد الرحمن، عن سليمان، وذلك من كتابه قراءة علينا