It is narrated from Abdullah bin Umar (may Allah be pleased with them both) that he said: "The people of Quba were offering the morning prayer when a man came and said that last night the Qur'an was revealed to the Messenger of Allah (ﷺ) in which he was commanded to pray facing the Ka'bah. So the people turned their faces towards it. Their (the people of Quba's) faces were towards Syria, and they turned towards the Ka'bah (during the prayer)."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 177
Hadith Takhrijأخرجہ البخاری، الصلاۃ، باب ماجاء فی القبلۃ، ومن لم یر الاعادة علی من سہا، فصلی الی غیر القبلۃ: 403 - ومسلم، المساجد، باب تحویل القبلۃ من القدس الی الکعبة: 526
It is narrated from Ibn Umar (may Allah be pleased with them both) that he said: "The people were performing the Fajr prayer in Quba when a man came and informed them that during the night, Qur'an had been revealed to the Prophet ﷺ in which he was commanded to face the Ka'bah (in prayer). So those people also turned their faces towards the Ka'bah, while at that time their faces were towards Syria; they all turned towards the Ka'bah."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 178
Hadith Takhrijأخرجہ البخاری، الصلاۃ، باب ماجاء فی القبلۃ، ومن لم یر الاعادة علی من سہا، فصلی الی غیر القبلۃ: 403 - ومسلم، المساجد، باب تحویل القبلۃ من القدس الی الکعبة: 526
Saeed bin Musayyib narrates: "The Messenger of Allah (ﷺ) prayed facing Bayt al-Maqdis for sixteen months, then two months before the Battle of Badr, the Qiblah was changed."
Hadith Referenceمسند الإمام الشافعي / كتاب الصلاة / 179
Hadith Takhrijاسنادہ مرسل لکنہ صح من حدیث البراء بن عازب الذی أخرجہ البخاری، الایمان، باب الصلاۃ من الایمان: 40 - ومسلم، المساجد، باب تحویل القبلۃ من القدس الی الکعبۃ: 525۔