According to an authentic narration Imam as-Sadiq the Holy Prophet once said, “Appreciate the value of bread, because for its making the entire creation of Allah situated between His throne and the earth have toiled.” Then he told the people around him: “Do you want me to tell you something?” They replied, “Surely, O Prophet of Allah! may our parents be sacrificed for you! Do enlighten us.” The holy Prophet said, “Before your time, there was a Divine Messenger named Daniel.
Once upon a time he gave a bread (loaf) to a ship-fairer and requested him to take him across the river. That fellow threw away the bread retorting: What shall I do with this bread? A number of it is being wasted all around us all the time. Shocked by the behavior of that man Daniel raised his hands towards the heavens and exclaimed: O Nourisher of the universe! You have already seen what this man has done to this loaf, and what he said about it.
Almighty Allah ordered the sky to stop raining and commanded the earth to become as hard as baked bricks so that even grass may not sprout therefrom. Consequently there was a famine which became so severe that people began to kill and eat one another. The intensity of famine reached the extent willed by Allah so as to make the people disciplined. One woman who had a baby son told another woman who also had a baby son: Today I will slaughter my son so that both of us may eat his flesh; tomorrow you should do likewise with your son. Then she killed her son and both ate his flesh.
The next day when both became hungry the other woman refused to kill her son. Quarrelling with one another they approached Daniel for judgment. He exclaimed: Has the condition worsened so much that you are prepared to eat up your own offspring’s? They said, “Yes, O Messenger of Allah! The situation is even worse than that.” So Daniel raised his hands to pray to Allah and said, O Provident of sustenance to all! Resume Your Mercy upon us and please do not chastise the poor and their children because of the sins of proud men like the ship-fairer and other thankless people. So Allah commanded the sky to shower rain and ordered the earth to grow grains and said, Compensate the loss of My creation which they suffered until now. I have shown My Mercy to them due to the young children.
Reference: Hayat Al-Qulub, Vol. 1, Stories of the Prophets