Exporting to excel works well for up to 10000 records but above that it returns me the error: "127.0.0.1 is currently unable to handle this request. HTTP ERROR 500 " Has anyone had this problem?
public function getUsersRegion($region){
$region = is_array($region) ? $region : array($region);
$users = DB::table("users")
->join("regions", "users.region", "=", "regions.id")
->select("users.id" , "users.avatar", "users.first_name", "users.last_name", "users.email", "regions.name", "users.ref_code", "users.banned")
->whereIn("users.region", $region)
->orderBy("users.id", "desc")
->get();
return $users;
}
public function export($region, $format) {
$retorno = $this->getUsersRegion($region);
Excel::create('Painel Gerenciador de Conteudo', function($excel) use ($retorno, $format){
$excel->sheet('Painel Gerenciador de Conteudo', function($sheet) use ($retorno, $format){
$sheet->loadView('exports.export')->with('retorno',$retorno)->with('format',$format);
});
})->export($format);
}