I am new to the Laravel. I got this project and I don't know why this is not displaying pictures

116 Views Asked by At

Things I tried 1.simple path without URL::to 2.url() method 3.absolute path 4.asset(simple relative path) in my .env file changed APP_URL from http://localhost to http://localhost:8000 since it runs on 8000 port I am adding some pictures. One thing which is important to mention here when i use Simple relative path it shows picture on hovering the mouse in IDE and on browser too but browser does not render it on webpage. Please see pictures

src="{{URL::to('public/imgs/2.png')}}"

1

There are 1 best solutions below

3
Mustafa Poya On

You have to put all your image resource files in public folder then access those resources through the following way:

    src="{{ URL::asset('imgs/2.png') }}"