php - Laravel Excel Img src 无法从存储中工作
问题描述
我正在尝试使用图像导出 excel,但出现此错误。
(1/1) PHPExcel_Exception 文件 http://127.0.0.1:8000/storage/photos/3x1HVvwYYNXAZxc/1.jpg未找到!
当我按下链接时,它会显示照片。
我的控制器:
public function WholeSaleStockExport(Request $request, BidFilters $filters)
{
Excel::create('name: ' . date("Y/m/d"), function($excel ) use($filters, $request) {
$excel->sheet('today', function($sheet) use($filters, $request) {
$bid = ClientCar::filter($filters)->orderBy('lot_date', 'ASC')->get();
$sheet->loadView('manager.sheets.wholesale', array('cars' => $bid));
});
})->download('xls');
}
在我看来,我有这个:
<img src="{{ asset('/storage/photos/') . '/' . $car->lot_id . '/' . '1.jpg' }}" width="80px">
我怎么解决这个问题?
解决方案
推荐阅读
- python - 使用 Python 请求模块的 SSL 或代理错误
- vb.net - 如何让应用程序检查应用程序目录中是否存在 EXE 文件?
- c++ - VS profiler,源信息不可用
- python - 分组和旋转数据框
- python-3.x - 公钥加密是否可以用于保护此 OpenId Connect 工作流程的最后一站
- reactjs - 优化组件 React Hooks 中的计算
- c++ - 将字符串转换为 Arduino 的字符
- node.js - 尝试在 mp3 上使用 LAME - 获得 MPEG-2.5 仅受 Layer3 支持
- python - Python - 从服务总线主题读取消息,然后将它们存储在具有相同名称的容器中
- python - Python 如何从一周的 CSV 中计算每周每天一小时发生的事情的次数?