Skip to content

Instantly share code, notes, and snippets.

@thanhtutoo
Created June 12, 2018 16:02
Show Gist options
  • Save thanhtutoo/ddd7daeb66b27e784f40faf3c205a907 to your computer and use it in GitHub Desktop.
Save thanhtutoo/ddd7daeb66b27e784f40faf3c205a907 to your computer and use it in GitHub Desktop.
please put under " public function downloadExcel($type) " function
private function transformCollection($collection){
return array_map([$this, 'transform'], $collection->toArray());
}
private function transform($collection){
return [
// 'Full Name' => $collection['jobseeker_id']. ' '. $collection['fullname']. ' '. $collection['date'],
// 'Phone No' => $collection['date'],
// 'Full Address' => $collection['id']. ' '. $collection['fullname']
'fullname'=>$collection['fullname'],
'jobseeker_id'=> $collection['jobseeker_id'],
'date'=>$collection['date'],
'active_inactive'=>$collection['active_inactive'],
'fb_name'=> $collection['fb_name'],
'gender' => $collection['gender'],
'age' => $collection['age'],
'expected_salary' => $collection['expected_salary'],
'expected_salary_other' => $collection['expected_salary_other'],
'education' => $collection['education'],
'nrc_no'=>$collection['nrc_no'],
'township'=>$collection['township'],
'wards' => $collection['wards'],
'bus_stops' => $collection['bus_stops'],
// 'bus_stops' => $collection['Otherbusstops'],
'previous_function_1' => $collection['previous_position_1'],
'certification_and_license' => $collection['certification_and_license'],
'fabrics' => $collection['fabrics'],
'experience_month_1' => $collection['experience_month_1'],
'company_name_1' => $collection['company_name_1'],
'previous_position_1' => $collection['previous_position_1'],
'previous_position_2' => $collection['previous_function_2'],
'previous_position_other' => $collection['previous_position_other'],
'previous_position_other_2' => $collection['previous_position_other_2'],
'previous_function_2' => $collection['previous_function_2'],
'desire_function_1' => $collection['desire_function_1'],
'desire_function_2' => $collection['desire_function_2'],
'type_of_license' => $collection['type_of_license'],
'experience_month_2' => $collection['experience_month_2'],
'company_name_2' => $collection['company_name_2'],
'desire_position_1' => $collection['desire_position_1'],
'desire_position_other_1' => $collection['desire_position_other_1'],
'desire_position_2' => $collection['desire_position_2'],
'desire_position_other_2' => $collection['desire_position_other_2'],
// 'job_industry_1' => $collection['Desired_Industry'],
// 'job_industry_2' => $collection['other_industry'],
'skill_1' => $collection['skill_1'],
'skill_other_1' => $collection['skill_other_1'],
'skill_2' => $collection['skill_2'],
'skill_other_2' => $collection['skill_other_2'],
'viber_number' => $collection['viber_number'],
'phone'=>$collection['phone'],
'chatfuel_user_id'=>$collection['chatfuel_user_id'],
// 'last_user_freedom_input'=>$collection['last_user_freeform_input'],
'messenger_user_id' =>$collection['messenger_user_id'],
// 'profile_pic_url' =>$collection['profile_pic_url'],
'certificate' =>$collection['certificate'],
'certificate_other' =>$collection['certificate_other']
];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment