Laravel symbolic link to storage

跟風遠走 提交于 2019-12-24 14:26:04

问题


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

where I have images 1.png, 2.png and so on ...

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?


回答1:


This command will create a link between public/storage and storage/app/public.

So, change this:

{{ asset('clients/1.png') }}

To:

{{ asset('storage/clients/1.png') }}

https://laravel.com/docs/5.5/filesystem#the-public-disk



来源:https://stackoverflow.com/questions/48194730/laravel-symbolic-link-to-storage

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