【发布时间】:2018-10-29 13:00:41
【问题描述】:
我在同一目录中有两个页面home.blade.php 和post.blade.php,即:resources/views 目录。当我在主页中显示图像时:
<img src="storage\file_uploads\{{$item->id}}">
它运行良好并显示图像。但是当我在帖子页面中做同样的事情时:
<img src="storage\file_uploads\{{$post->id}}">
<!-- It is needed to mention that the $post and $item variable are not causing the problem for sure and the file does exist-->
我已经运行了一个 php artisan 命令:php artisan storage:link 来链接公共文件夹和存储文件夹,一切都很顺利。
那么,可能是什么问题。
【问题讨论】:
-
到底是什么问题?为什么在 Web 上下文中使用反斜杠?
-
已经解决了!