Merge pull request #137 from WDI-Ideas/sayaliP

Sayali p
This commit is contained in:
CodewithSayali
2024-06-13 15:08:50 +05:30
committed by GitHub
2 changed files with 13 additions and 25 deletions

View File

@@ -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'
];
}
}

View File

@@ -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');
// }
/*