The phrase originates in Luke 12:19 (KJV), part of the Parable of the Rich Fool:
"And I will say to my soul, Soul, thou hast much goods laid up for many years; take thine ease, eat, drink, and be merry."
Jesus tells the parable to warn against greed and false security. The rich man dies that night; his stores profit him nothing.
Shakespeare references the sentiment but does not coin it:
The proverbial form is biblical. Shakespeare uses it; he doesn’t originate it.