My images do not appear in laravel

0

In a Project in Laravel, I want to upload an image.

Like this

 <img class="logo" src="{{ asset('images/'. $pet->image) }}">

Since the images are in the public folder

But, tell me this

Failed to load resource: the server responded with a status of 404 (Not Found)

the image is, the path is fine, but for some reason it does not recognize the images folder,

images:1 GET http://127.0.0.1:8000/images 404 (Not Found)

should say http://127.0.0.1:8000/images/1.png

Why is this happening?

    
asked by Bella 27.01.2018 в 11:17
source

1 answer

1

As you can see, you are trying to make this upload:

<img class="logo" src="{{ asset('images/'. $pet->image) }}">

The issue of receiving the error is because you are trying to load a folder in the path of an image, because apparently your problem is in the loading of the info.

You must verify that this variable is bringing the information or name of the image to be displayed:

$pet->image

Try placing it manually to see if it gives you the same error:

<img class="logo" src="{{ asset('images/1.png') }}">

I also recommend you to work with the local server Laragon, which is perfect for developments with Laravel, among other things.

    
answered by 27.01.2018 в 12:32