劳驾,
我想使用laravel-excel导出我的报告.
这是控制器:
public function getExcelfile(){
$users = UserService::findAllPublic();
$total = UserService::count();
$total_with_photo = UserService::countWithPhoto();
Excel::create('excelfile',function($excel) use ($users,$total,$total_with_photo) {
$excel->sheet('Excel',function($sheet) use ($users,$total_with_photo) {
$sheet->loadView('report.excel')->with("users",$users)->with("total",$total)->with("total_with_photo",$total_with_photo);
});
})->export('xls');
}
然后出现此错误:
PHPExcel_Exception
File http://myserver.com/projectname/public/assets/images/upload/DSCN1164.jpg not found!
当我尝试在浏览器中访问它时,该文件存在.
最佳答案
代替:
原文链接:https://www.f2er.com/html/426090.html
你应该使用:
当然假设它是正确的路径