Laravel 5.4储存连结 [英] Laravel 5.4 Storage link
问题描述
我想在html文件中显示图片,我转到链接文件夹 公共/存储/图像为空,但在存储/图像中我找到了文件并 它也保存在数据库中.*
i would like to show a picture in html file i go to the link folder public/storage/image is empty but in the storage/image i find the file and its also saved in the data base.*
@foreach($cvs as $cv)
<div class="col-sm-6 col-md-4">
<div class="thumbnail">
<img src="{{ asset('storage/'.$cv->photo) }}" alt="...">
<div class="caption">
<h3>{{ $cv->titre }}</h3>
<p>{{$cv->presentation}}</p>
<p>
<a href="#" class="btn btn-primary" role="button">Afficher</a>
<a href="#" class="btn btn-success" role="button">Modifier</a>
<a href="#" class="btn btn-danger" role="button">Supprimer</a>
</p>
</div>
</div>
</div>
@endforeach
</div>
</div>
推荐答案
public
磁盘用于将要公开访问的文件.默认情况下,public
磁盘使用本地驱动程序,并将这些文件存储在storage/app/public
中.为了使它们可以从Web上访问,您应该创建一个从public/storage
到storage/app/public
的符号链接. Laravel文档
The public
disk is intended for files that are going to be publicly accessible. By default, the public
disk uses the local driver and stores these files in storage/app/public
. To make them accessible from the web, you should create a symbolic link from public/storage
to storage/app/public
. Laravel doc
在 Linux
ln -s source_file myfile
这篇关于Laravel 5.4储存连结的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!