在laravel excel中导出多个文件

在laravel excel中导出多个文件,excel,laravel,Excel,Laravel,代码 public function collection() { $t= DB::table('sites')->select('site_code')->get(); for($i=0 ; $i<count($t); $i++){ $site=DB::table($t[$i]->site_code)->get(); } return $site; } 从这

代码

 public function collection()
    {
        $t= DB::table('sites')->select('site_code')->get();
        for($i=0 ; $i<count($t); $i++){
            $site=DB::table($t[$i]->site_code)->get();
        }
        return $site;
    }

从这段代码中,我只下载了上一个文件

上已经列出的同一版本

根据他们的答复:


不可能在同一请求中下载多个文件。你 可以
store()
多个文件,然后将其作为
zip
文件下载


您使用的是
Maatwebsite
库吗?是的,兄弟,我使用的是Maatwebsite,不可能在同一请求中下载多个文件。您可以存储()多个文件,然后将其作为zip文件下载。
 public function siteexport()
    {
       return Excel::download(new sites(), 'download.xlsx');
    }