Skip to content
Advertisement

Laravel (windows) storage path

I have a problem that I do not know how to resolve. Running Wamp64 on windows. Image is stored in storage/app/uploads whatever…

However, this code:

{{ storage_path('app/').$post->image_path }}

gives me error as it cannot find image:

D:wamp64wwwlounginatorstorageapp/uploads/imagename.jpg

Of course, as slashes are mixed with backslashes. If I upload it to Linux server, all works, of course.

How to overcome this?

Advertisement

Answer

{{ asset("storage/{$post->image_path}")  }}
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement