Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
bayhaqi:5062[Chain 1] Abū ʿAbdullāh al-Ḥāfiẓ And ʾAbū Saʿīd b. Abū ʿAmr > Abū al-ʿAbbās Muḥammad b. Yaʿqūb > ʿAbbās al-Dūrī > ʿĪsá b. al-Mundhir al-Ḥimṣī > Baqiyyah b. al-Walīd > Baḥīr b. Saʿd [Chain 2] Abū ʿAlī al-Rūdhbārī > Muḥammad b. Bakr > Abū Dāwud > Ibrāhīm b. Mūsá > Abū Dāwud > Ḥaywah b. Shurayḥ > Baqiyyah > Baḥīr > Khālid > Abū Ziyād Ḥayyān b. Salamah

[Machine] Indeed, the last meal eaten by the Messenger of Allah ﷺ was a meal that included onions. This is mentioned in the book of Hayyan. They also said that it was cucumbers. The sheikh said it was cucumbers, and in the narration of Isa (Jesus), it was also mentioned as cucumbers. Bukhari also mentioned it in his book about Haywan that it was cucumbers.  

البيهقي:٥٠٦٢أَخْبَرَنَا أَبُو عَبْدِ اللهِ الْحَافِظُ وَأَبُو سَعِيدِ بْنُ أَبِي عَمْرٍو قَالَا ثنا أَبُو الْعَبَّاسِ مُحَمَّدُ بْنُ يَعْقُوبَ ثنا عَبَّاسٌ الدُّورِيُّ ثنا عِيسَى بْنُ الْمُنْذِرِ الْحِمْصِيُّ ثنا بَقِيَّةُ بْنُ الْوَلِيدِ ثنا بَحِيرُ بْنُ سَعْدٍ ح وَأَخْبَرَنَا أَبُو عَلِيٍّ الرُّوذْبَارِيُّ أنبأ مُحَمَّدُ بْنُ بَكْرٍ ثنا أَبُو دَاوُدَ ثنا إِبْرَاهِيمُ بْنُ مُوسَى قَالَ أَخْبَرَنَا وَقَالَ أَبُو دَاوُدَ وَحَدَّثَنَا حَيْوَةُ بْنُ شُرَيْحٍ ثنا بَقِيَّةُ عَنْ بَحِيرٍ عَنْ خَالِدٍ عَنْ أَبِي زِيَادٍ حَيَّانَ بْنِ سَلَمَةَ أَنَّهُ سَأَلَ عَائِشَةَ ؓ عَنِ الْبَصَلِ فَقَالَتْ

إِنَّ آخِرَ طَعَامٍ أَكَلَهُ رَسُولُ اللهِ ﷺ طَعَامٌ فِيهِ بَصَلٌ هَكَذَا فِي الْكِتَابِ حَيَّانُ وَقَالُوا الصَّوَابُ خِيَارٌ قَالَ الشَّيْخُ وَفِي رِوَايَةِ عِيسَى خِيَارٌ وَكَذَلِكَ قَالَهُ الْبُخَارِيُّ فِي التَّارِيخِ عَنْ حَيْوَةَ خِيَارٌ