如何在php laravel excel中将一张表复制到另一张表


How to copy a sheet to another in php laravel excel?

我的问题正如标题所说!如何使用maatewebsite的laravel excel将excel表内容复制到另一个表中!

Excel::load(Input::file('file'), function($file)
    {     
        $sheet1 = $file->setActiveSheetIndex(0);
        Excel::create('Filename', function($excel) use($sheet1) {
            // Create first sheet
            $excel->sheet('First sheet', function($sheet) use ($sheet1){
                $sheet = $sheet1;
            });
        })->export('xls');
    });
Excel::load(Input::file('file'), function($file)
    {     
        $sheet1 = $file->setActiveSheetIndex(0);
        Excel::create('Filename', function($excel) use($sheet1) {
            // add $sheet1 for new file
            $excel->addExternalSheet($sheet1)
        })->export('xls');
    });