在Laravel中访问公用文件夹中的图像 [英] Access images inside public folder in laravel

查看:38
本文介绍了在Laravel中访问公用文件夹中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何不使用Laravel自身的功能(如assets())访问public/images文件夹中存储的图像?

How can I access the images stored inside public/images folder without the use of Laravel's own functions like assets()?

我只想获取存储在images文件夹中的图像的直接URL.

I just want to get the direct URL of the images stored in images folder.

例如:

localhost/webapp/images/stackoverflow.png

当请求链接时,我应该获得直接图像.

When requesting the link i should get the direct image.

推荐答案

如果您位于刀片模板中

{{ URL::to('/') }}/images/stackoverflow.png

这篇关于在Laravel中访问公用文件夹中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆