@jamesfrancisramos7 Please format the code by using backticks ``` before and after the code.
Jan 22, 2018
10
Level 1
Export to excel but error "Illegal Offset type"
I'm trying to export but it there's an error saying "Illegal Offset type". My code in my UsersController goes like this, please help me experts.
public function userExport()
{
$users = $this->users->paginate(
$perPage = 20,
Input::get('search'),
Input::get('status'),
Input::get('emp_status'),
Input::get('level'),
Input::get('age'),
Input::get('gender'),
Input::get('civil_status'),
Input::get('role_id'),
Input::get('birthmonth'),
Input::get('company'),
Input::get('branches'),
Input::get('benefit'),
Input::get('designation'),
Input::get('tenure')
);
// Input::get('gender')
return Excel::create('data_function',function($excel) use ($users){
$excel->sheet('mysheet', function($sheet) use ($users){
$sheet->fromArray($users);
});
})->download('xls');
}
Please or to participate in this conversation.