Luqman is also known as "Luqman the Wise" or "Luqman al-Hakeem," after whom Surah 31 of the Quran, is named. He was a contemporary of Prophet Dawud عَلَيْهِ ٱلسَّلَامُ.
One of the incidents of Luqman's life noted in the books of history was that he was taken prisoner and sold to an influential man. The more this great personage observed Luqman's work, the more he was impressed by his slave's intelligence, sense, wisdom, knowledge, and faith. He became fond of Luqman and respected him.
Gradually things proceeded to the point that Luqman's master began to love him as though he were his son or brother and treat him as though he were a companion and confidant. On every occasion, the master showed his servant Lugman honor and respect and offered the most choice morsels of food to him at meals as a sign of his affection.
Things were thus when a melon was brought to the master, the first fruit from his fields. He took a knife and cut a piece for Luqman. Luqman took it and ate it. It was apparent from the expression on his face that it satisfied him. This pleased the master, and he cut another piece and offered it to Luqman. Out of courtesy, Luqman accepted it and ate it as though he relished it. Then he thanked the great man. This increased his master's delight, so he cut still another piece and gave it to Luqman. He continued doing this until there was only one slice left. The master said to himself, "Now I can eat a slice of this first fruit melon my self."
But when he ate it, he realized that the melon was spoiled and very bitter. He washed out his mouth and after a while said to Luqman:
"Dear friend, that melon was incredibly bitter, and I didn't know it. How is it that you didn't say anything about its bitter taste? Such patience is very difficult!"
"Yes," answered Luqman, "the melon was very bitter, but I have received much sweetness from your hands, and I didn't want to complain of the one-time bitterness of the melon. You have held me dear, and I have held you, dear. I always advise people that they must be grateful for the goodness of others. How could I not follow my own advice? I wish that you had given me that last piece so that you might have been happy with this show of your affection, just as I am satisfied and happy with your goodness and generosity."