Allah's Messenger (ﷺ) used to pray (optional, non-obligatory prayer) while riding on his…

Sahih al-Bukhari Book 8 Hadith 51

Sahih al-Bukhari #400

Prayers (Salat) 8:51

Narrated Jabir:

Allah's Messenger (ﷺ) used to pray (optional, non-obligatory prayer) while riding on his mount (Rahila) wherever it turned, and whenever he wanted to pray the compulsory prayer he dismounted and prayed facing the Qibla.

Chapter: [During the obligatory Salat (prayers)] one should face the Qiblah (Kabah at Makkah) wherever one may be

Grade: Sahih