I can not get images in Laravel

2

You see, I have a view that shows a list of plants. Before this, I show a picture of a fern with this code:

<img src="helecho.jpg" style="width: 200px; height: 200px; border: 2px solid red">

I have placed the photo in the same directory as the PHP document with my view (index.blade.php).

However, the image is not displayed.

What could I be doing wrong? In fact, I've tried the same image in an isolated html and if it looks.

    
asked by Miguel Alparez 14.02.2018 в 18:57
source

2 answers

2

Basically this would be an example of adding the image, in the blade views. in the same way you have to place your image in the public directory.

<img src="{{URL::asset('directory/name_of_image_file.file_format')}}"
    
answered by 14.02.2018 в 19:16
0

I have already solved it, although it could be seen as a fudge. It was put this change in the code:

<img src="http://localhost/flora/resources/views/vegetal/helecho.jpg" style="width: 200px; height: 200px; border: 2px solid red">

And ready:

    
answered by 14.02.2018 в 19:13