From Sahih Bukhari (Hadith 1101):
Narrated Hafs bin `Asim:Ibn `Umar went on a journey and said, "I accompanied the Prophet (ﷺ) and he did not offer optional prayers during the journey, and Allah says: 'Verily! In Allah's Messenger (ﷺ) you have a good example to follow
Reference: Bukhari 1101