【发布时间】:2023-03-10 00:10:01
【问题描述】:
我正在尝试检索图像。我没有通过php artisan storage:link 方法创建从 public/storage 到 storage/app/public 的符号链接。而不是这个,我将此代码添加到App::make('files')->link(storage_path('app/public'), public_path('storage')); 到app/providers/AppServiceProvider.php。但是仍然没有运气图像没有显示,也没有错误。
查看代码:
<img src="/public/storage/{{$main->image_dir}}" /> // /public/storage/main/image.jpg
<img src="/storage/{{$main->image_dir}}" /> // /storage/main/image.jpg
<img src="http://localhost:8000/storage/{{$main->image_dir}}" /> // http://localhost:8000/storage/main/image.jpg
我没有通过以上 3 个链接获得图像。图片存储在这里:storage/app/main。
【问题讨论】:
-
嗨,你的问题看起来更像是谷歌搜索而不是问题,你不觉得吗?
-
@JuangaCovas 真的吗?是什么让你这么认为?
标签: php laravel laravel-5.5 file-storage