Reputation: 65
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
Upvotes: 2
Views: 276
Reputation: 892
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')}}
Upvotes: 1