@@ -13,14 +13,16 @@ class customer_export implements FromCollection , WithHeadings
|
||||
/**
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
public function collection()
|
||||
{
|
||||
return IamPrincipal::select(
|
||||
'first_name',
|
||||
'email_address',
|
||||
'date_of_birth',
|
||||
'phone_number'
|
||||
)->get();
|
||||
|
||||
|
||||
public function collection(){
|
||||
return IamPrincipal::where('principal_type_xid',3)
|
||||
->select('first_name',
|
||||
'email_address',
|
||||
'date_of_birth',
|
||||
'phone_number')->get();
|
||||
|
||||
|
||||
}
|
||||
|
||||
//function header in excel
|
||||
@@ -33,4 +35,6 @@ class customer_export implements FromCollection , WithHeadings
|
||||
'phone_number'
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -238,23 +238,7 @@ class ManageCustomerController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
// public function exportSelectedCustomer(Request $request)
|
||||
// {
|
||||
// $data=null;
|
||||
// $type = $request->input('type'); // 'overview' or 'selected'
|
||||
|
||||
// if ($type === 'overview') {
|
||||
// // Fetch all data from the database
|
||||
// $data = IamPrincipal::all();
|
||||
// } elseif ($type === 'selected') {
|
||||
// // Fetch selected data based on IDs
|
||||
// $selectedIds = $request->input('selected_ids');
|
||||
// $data = IamPrincipal ::whereIn('id', $selectedIds)->get();
|
||||
// }
|
||||
|
||||
// // Generate Excel
|
||||
// return Excel::download(new customer_export($data), 'customers.xlsx');
|
||||
// }
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user