Laravel符号链接到存储 [英] Laravel symbolic link to storage
问题描述
我在使用laravel创建符号链接以访问存储中的某些图像时遇到一些问题...
I have some problems creating a symbolic link with laravel to access some images that are in my storage ...
我将图像存储在文件夹中
I store my images in the folder
storage\app\public\clients
我有图像1.png,2.png等...
where I have images 1.png, 2.png and so on ...
我使用php artisan命令创建了链接
I used the php artisan command to create the link
php artisan storage: link
The [public/storage] directory has been linked.
现在,当我尝试访问视图时,以下路径不起作用
now when i try to access in my view the following path does not work
<img id = "thumbnail" src = "{{asset ('clients / 1.png')}}" width = "150px"> </ img>
我是否需要做其他任何事情才能公开访问存储文件夹?
do I have to do anything else to gain access to the storage folder in public?
推荐答案
此命令将在public/storage
和storage/app/public
之间创建链接.
This command will create a link between public/storage
and storage/app/public
.
因此,请更改此内容:
{{ asset('clients/1.png') }}
收件人:
{{ asset('storage/clients/1.png') }}
https://laravel.com/docs/5.5/filesystem#the -public-disk
这篇关于Laravel符号链接到存储的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!