The Messenger of Allah ﷺ made an agreement with the people of Khaibar to work and cultivate in return for half of the fruits or produce. (Using translation from Abū Dāʾūd 3408)
أَنَّ رَسُولَ اللهِ ﷺ عَامَلَ أَهْلَ خَيْبَرَ بِشَطْرِ مَايَخْرُجُ مِنْ تَمْرٍ أَوْ زَرْعٍ