Soon thereafter, a man from the Quraish came to me and complained of poverty. On hearing his complaint, I informed him of my situation and how I had taken a loan to fulfill our needs, and then said to him, “Take from my wealth whatever amount you wish.” The man looked at the fifty dinars and said, “The amount that I need is even more than these dinars!” Hearing this, I urged him saying, “Take it all!” Hence, the man took all the fifty dinars and left. Thus, I went to bed that night in the condition where I had neither dinars nor dirhams in my possession.
After some time, while I was in my home, the messenger of Ja’far bin Yahya Barmaki came and summoned me. I responded to the summons, and when I came before Ja’far, he asked me, “What has happened to you tonight? Whenever I fall asleep, a voice calls out to me, ‘See to the need of Imaam Shaafi‘ee! See to the need of Imaam Shaafi‘ee!’ Inform me of your problem.” I thus informed him of my problem, after which he gave me five hundred dinars as a gift. He then said, “I wish to give you more.” He then gave me a further five hundred dinars, and continued to increase the amount that he gave me, until he had given me two thousand dinars.
(Manaaqib-ush-Shaafi‘ee lil-Bayhaqi 2/230)