php - 图像未在 Laravel 8 视图中显示
问题描述
当我第一次这样做时它正在工作,然后突然停止工作。
这是我的URL
{{url('storage/profilepictures/'.Auth::user()->profilepicture )}}
我已经使用过这个命令
php artisan storage:link
解决方案
使用 fromasset
代替URL
:
<img src="{{asset('/storage/profilepictures' .Auth::user()->profilepicture)}}" class="img-thumbnail" alt="Responsive image">
如果你想获得登录用户的照片,你可以得到它,如下所示:
Auth::user()->profilepicture
或者:
auth()->user()->profilepicture
推荐阅读
- angular - Angular 10/Ionic 5 - 将输入数据从模式传递到父组件,然后提交到 firebase 数据库
- kubernetes-helm - Helm Go 模板将现有值与外部 json 文件相结合
- python - 使用列值查找列名
- python - 在 Python 中的函数之间传递变量,然后返回菜单
- react-native - 添加动态标签导航屏幕的正确方法:createMaterialTopTabNavigator
- excel - 将 Excel 电子表格中的 TXT 文件导入特定单元格
- c# - Ef Core 3.1 Generate primary key by properties
- c# - WPF Scrollviewer 不允许我滚动并认为它的高度是无限的
- php - Docker PHP ext启用命令失败
- python - 有没有办法为 Jupyter Notebook 制作桌面快捷方式?