Created
June 9, 2018 18:37
-
-
Save thanhtutoo/d3ad0893234bf68aceefc56137d2c1f2 to your computer and use it in GitHub Desktop.
please replace downloadExcel function with the following line of codes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//for download excel | |
public function downloadExcel($type) | |
{ | |
ini_set('max_execution_time', 3000); | |
set_time_limit ( 3000 ); | |
$user = new Jobseeker; | |
$data = $user->query(); | |
try{ | |
$filedate = str_replace(' ', '_', Carbon::now()); | |
return Excel::create('UserList'.$filedate, function($excel) use($data){ | |
$data->chunk(10000, function ($users) use($excel) { | |
$collection = $this->transformCollection($users); | |
$excel->sheet('OrgSubUserList', function($sheet) use($collection){ | |
$sheet->fromModel($collection, null, 'A1', true); | |
}); | |
}); | |
})->export('xlsx'); | |
} | |
catch(Exception $e) | |
{ | |
return false; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment