Laravel-如何还原本地存储符号链接和刷新 [英] Laravel - How to revert local storage symlink and refresh

查看:81
本文介绍了Laravel-如何还原本地存储符号链接和刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将图像保存到存储中时,它们会显示在 storage/app 目录中,但不会显示在 public/storage 中.我还注意到,似乎已创建一个 storage/app/public 目录,该目录还包含storage/app中的所有内容.

When I save images to storage they show in the storage/app directory, but they don't show in public/storage. I also noticed that a storage/app/public directory seems to have been created which also contains everything within storage/app.

我无法弄清楚如何造成这种混乱,我认为将这些目录还原为开始时的样子(使用新的laravel项目),删除所有现有的符号链接可能是有意义的,然后重新开始-听起来是最好的方法吗?如果我没有正确设置符号链接,该怎么办?

I can't work out how I managed to cause this mess, and I think it might make sense to revert these directories to how it should have been to begin with (with a new laravel project), remove any existing symlinks, and start again - does this sound like the best approach? And how would I go about doing this if I have set the symlink up incorrectly?

推荐答案

您始终可以删除链接:

cd public
rm storage

如果需要链接不同的位置,则不使用 storage:link 命令创建一个新的链接:

And create a new one without using the storage:link command if you need to link different locations:

\File::link(storage_path('dir1'), public_path('dir2'));

手动创建符号链接:

ln -s /full/path/to/storage/dir1 /full/path/to/public/dir2

这篇关于Laravel-如何还原本地存储符号链接和刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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