To enable casting shadows with LineRenderer you need to take a look at two things:
The material (and its shader) used by the LineRenderer must allow for casting shadows. You can use the Default-Diffuse or Default-Material. You can also make your own material and assign “Particles/Standard Unlit” shader to it- this will ensure that the color of the line will stay the same regardless of the lighting source.
Because the angle of a casted shadow of a LineRenderer is determined by the position of the light source rather than by the position of the camera, we recommend you to change the line’s Alignment option from View to Transform Z and manualy rotate it as needed.
For anyone having this problem, double check the following:
Are you using proper material for your line renderer? If you’re not sure which, try to use Standard material.
Is your object casting shadow on other surfaces, i.e, a Plane object? Sometimes it does not cast the shadow to the line renderer due to Project Settings > Quality > Shadow Distance.
Did you try to check Generate Lighting Data on Line Renderer component?
¿What material are you using? Maybe it's set as emissive.
– mikelortega