Mishkat al-Masabih
Ibn 'Abbas said that the Prophet (ﷺ) got his sword Dhul Fiqar as private booty at the battle of Badr. Ibn Majah transmitted it, and Tirmidhi added that it was that about which he had the vision at the battle of Uhud.
وَعَنِ ابْنِ عَبَّاسٍ أَنَّ النَّبِيَّ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ تَنَفَّلَ سيفَه ذَا الفَقارِ يومَ بدْرٍ رَوَاهُ أَحْمد وَابْن مَاجَهْ وَزَادَ التِّرْمِذِيُّ وَهُوَ الَّذِي رَأَى فِيهِ الرُّؤْيَا يَوْم أحد
Reference