I got a problem while working with Laravel 5.4. I do need to load some pics which are under the public folder public/img
. In order to do so, I tried the following lines of code in my blade view:
<img src="{{Config::get('app.url')}}/public/img/boy.png" width="30"/>
<img src="{{url('/img/boy.png')}}" />
In both of the cases, I get this URL which looks (apparently) ok: http://localhost/public/img/boy.png
. My application is running fine on this URL: http://localhost:8000/
.
The problem is that pic (as well as others in the same folder), cannot be loaded. On the HTML page, I get the following error in the console: http://localhost/public/img/boy.png 404 (Not Found)
.
How can it be possible? Actually, if I try to go to http://localhost/public/img/boy.png
, I get an error that the page does not exist.
How can this problem be solved? How can I get access to my files in the public folder? I have been spending the whole day trying to figure this issue out!
Thank you so much!