Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Can';t显示上传的图像laravel_Php_Laravel - Fatal编程技术网

Php Can';t显示上传的图像laravel

Php Can';t显示上传的图像laravel,php,laravel,Php,Laravel,我试图上传图像以在视图中显示它,但当我试图显示它时,它不会显示在视图的图像部分 我已经有了symlink,它可以工作了。我可以在“public/storage/images”路径中看到我上传的图像。 它还显示在“存储\应用\公共\图像”路径上 显示图像的我的代码 @if(filled($book->image)) <img src="{{asset($book->image)}}" style="width: 8%;height:8%"&

我试图上传图像以在视图中显示它,但当我试图显示它时,它不会显示在视图的图像部分

我已经有了symlink,它可以工作了。我可以在“public/storage/images”路径中看到我上传的图像。 它还显示在“存储\应用\公共\图像”路径上

显示图像的我的代码

@if(filled($book->image))
<img src="{{asset($book->image)}}" style="width: 8%;height:8%">

使用
src=“{url('/images/'.$book->image)}}”

如果您想在blade中获取图像url,那么您可以使用url帮助程序,如
img src=“{{url('storage/app/public/images/'.$filename)}”

或者其他类似的地方


存储路径('/app/public/images/'.$filename)

像这样重写代码

<img src="{{asset('images/'.$book->image)}}" style="width:8%; height:8%">
image)}“style=”宽度:8%;身高:8%“>

如果您已经在命令行中运行了
storage:link

写入图像完整路径,则此功能应该可以正常工作
<img src="{{asset('images/'.$book->image)}}" style="width:8%; height:8%">