Skip to content
Advertisement

Problem with displaying pictures in laravel 7

i’m working on Laravel 7 , i want to display the images added by the administrator, but they don’t show up.

This is the index.blade.php :

  @foreach ($posts as $post)
          <div class="col-3">
      <div class="product__item">
  <div class="product__item__pic set-bg" data-setbg="{{asset('product/September2020/'.$post->Photo)}}">
       </div>
    </div>
</div>
@endforeach

This is the adress of the pictures : C:wamp64wwwProjectclientstorageapppublicproductSeptember2020

Thanks fo help

Advertisement

Answer

First create a symbolic link :

php artisan storage:link

Then a symbolic will create on your public folder with storage/app/public. Then you can access it as :

{{ asset('storage/product/September2020/'.$post->Photo) }} 
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement