Laravel 5.4储存连结 [英] Laravel 5.4 Storage link

查看:63
本文介绍了Laravel 5.4储存连结的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在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/storagestorage/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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆