There is an easier way. The following is for a receding shadow beneath and for an object that is floating level over a surface. It recognizes that if the distance from the shadow remains constant, the farther away something is, the sharper the shadow appears to be. This can also be used for a shadow from a vertical object by reversing the process vertically, in which case the blur increases over distance as the perceived ambient light washes out the shadow over distance.
Create the desired shape as a flat image; a straight-on birds-eye view, aligned on the X and Y (not at an angle). Make it large and make sure you have plenty of room at the sides.
Select and isolate the image, then transform > perspective and stretch the top right and left corners as wide as they can go and still have room for a broad blur. Blur the entire object to the maximum amount needed at the point that will be closest to the "camera".
Now select and isolate the result and use the perspective tool to squeeze the top corners together unit they are at the desired width. Now skew and distort the result so that it corresponds to the projected shape, then move it into position. Note that where the shadow is compressed horizontally, it will tighten up the pixels and give the false impression that it is darker. (If you wish, you can use the gradient trick below to compensate.)
If you want a more dramatic effect, create an empty layer mask and apply a vertical gradient from white to around 15% gray. This will make the shadow gradually fade out over the distance.
Another trick:
Create the shape of the shadow, then duplicate the layer as a backup and hide the original Create a new stand-alone channel and apply a black-to-white gradient. Use this to create a selection. With this selection active, apply your gradient. The lighter the area of the mask, the stronger the blur and vice-versa.
(This is old-school stuff. A million years ago I was a PS sysop on Compuserve.)