用户登录
用户注册

分享至

显示视图 Laravel 的文件夹图像

  • 作者: 霸气大丈夫
  • 来源: 51数据库
  • 2022-10-21

问题描述

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

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/images 和 public/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') }}">
软件
前端设计
程序设计
Java相关