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