Problem with displaying pictures in laravel 7

你。 提交于 2021-02-05 08:36:27

问题


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:\wamp64\www\Projectclient\storage\app\public\product\September2020

Thanks fo help


回答1:


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) }} 


来源:https://stackoverflow.com/questions/64099558/problem-with-displaying-pictures-in-laravel-7

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!