Search code examples
laravellaravel-5.3

Laravel images are not displayed


I want to display the images in my view. The images are located in public folder in folder name img.

I've tried following solutions:

 <img href="{{URL::to('img/zajeciadodatkowe.png')}}" alt="Image" height="200" width="200">

 <img src="{{URL::to('img/zajeciadodatkowe.png')}}" alt="Image" height="200" width="200">

 <img href="{{URL::asset('img/zajeciadodatkowe.png')}}" alt="Image" height="200" width="200">

 <img src="{{URL::asset('img/zajeciadodatkowe.png')}}" alt="Image" height="200" width="200">

 <img href="{{asset('img/zajeciadodatkowe.png')}}" alt="Image" height="200" width="200">

 <img src="{{asset('img/zajeciadodatkowe.png')}}" alt="Image" height="200" width="200">

This problem occured when I put the laravel app onto development server. Someone has any suggestions?


Solution

  • Use the asset() helper:

    <img src="{{ asset('img/zajeciadodatkowe.png') }}">
    

    And make sure the zajeciadodatkowe.png image is in public/img directory.