加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

php – laravel-excel无法使用带有图像的刀片导出xls文件

发布时间:2020-12-14 22:54:50 所属栏目:资源 来源:网络整理
导读:劳驾, 我想使用laravel-excel导出我的报告. 这是控制器: public function getExcelfile(){ $users = UserService::findAllPublic(); $total = UserService::count(); $total_with_photo = UserService::countWithPhoto(); Excel::create('excelfile',functi

劳驾,
我想使用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');
    }

这是位于报告文件夹的excel.blade.php:

然后出现此错误:

PHPExcel_Exception

File http://myserver.com/projectname/public/assets/images/upload/DSCN1164.jpg not found!

当我尝试在浏览器中访问它时,该文件存在.

最佳答案
代替:

你应该使用:

当然假设它是正确的路径

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读