首页 > 解决方案 > 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">

我怎么解决这个问题?

标签: phplaravel-5.4maatwebsite-excel

解决方案


推荐阅读