How to display image that is stored in public folder whose path is working fine?

Viewed 92

I'm trying to display the image that is stored in my public folder. The path to my image is being displayed when i just use {{$post-> image}} but i cant get the image to be displayed when i run the following command.

@foreach($posts -> $post)
      <tr>
                <td> <img src="{{ asset($post->image) }}" alt=""></td>
                <td> {{ $post-> title }} </td>
      </tr>
@endforeach

chrome screenshot folder screenshot

1 Answers

Base on your picture the only path you're calling is public/posts/picture.jpg but also based on your picture you need to call public/storage/posts/picture.jpg so you need

{{asset('storage/posts/picture.jpg')}}
Related