Martin
Martin

Reputation: 1279

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?

Upvotes: 2

Views: 606

Answers (1)

Alexey Mezenin
Alexey Mezenin

Reputation: 163748

Use the asset() helper:

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

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

Upvotes: 4

Related Questions