显示视图 Laravel 的文件夹图像

2021-12-18 00:00:00 php laravel laravel-5

如何从存储中访问直接图像?

How can I access a direct image from storage?

我将项目中的图像保存在 storage/images/clients/ 中,我如何检索这些图像并在视图中显示它们?

I'm saving the images from my project in storage/images/clients/ how do I retrieve those images and display them for the view?

推荐答案

您需要在 storage/imagespublic/images 之间创建符号链接:

You need to create a symbolic link between the storage/images and public/images:

ln -s /full/path/to/storage/images /full/path/to/public/images

然后你就可以使用这些图片了:

Then you'll be able to use these images:

<img src="{{ asset('images/clients/john.jpg') }}">

相关文章