While the people were at Quba performing the dawn prayer, someone came to them and said, "Quran was revealed to the Prophet ﷺ last night, and he has been commanded to face the Kaabah, so face it." Their faces had been toward Sham, so they turned to face the Kaabah.
حدثنا يحيى بن قزعة حدثنا مالك عن عبد الله بن دينار
بينا الناس بقباء في صلاة الصبح إذ جاءهم آت فقال إن النبي ﷺ قد أنزل عليه الليلة قرآن وقد أمر أن يستقبل الكعبة فاستقبلوها وكانت وجوههم إلى الشأم فاستداروا إلى الكعبة