Im trying to load an image from my /public/images folder in laravel. Im getting a 404 not found error. I know the image exists, and vscode even autocompletes the path for me.
here is the img tag:
<img src="/public/images/1616327614.jpg" class="im" alt="...">
and the file path:
I have also tried variations of the img src path, for example:
<img src="./public/images/1616327614.jpg" class="im" alt="...">
<img src="./images/1616327614.jpg" class="im" alt="...">
Any advice here would be greatly appreciated.
>Solution :
Try to do something like this,
<img src="{{asset('images/1616327614.jpg')}}" class="im" alt="...">
Or
<img src="{{public_path('images/1616327614.jpg')}}" class="im" alt="...">
Remember to always check the documentation: https://laravel.com/docs/9.x/helpers#method-public-path
