main
Ilham Wara Nugroho 2026-03-26 11:31:09 +07:00
parent 63cbe19971
commit f9ce9672bc
1 changed files with 20 additions and 42 deletions

View File

@ -152,9 +152,7 @@ class DatasetTambahanController extends Controller
// $sheet = $spreadsheet->getActiveSheet();
// $rows = $sheet->toArray();
// $header = $rows[4]; // Baris pertama sebagai header
if (@$request->hasFile('file')) {
$file = $request->file('file');
dd($file);
$destinationPath = public_path('uploads/dataset');
$current = Carbon::now()->format('Y/m/d');
$path = $destinationPath . '/' . $current;
@ -176,26 +174,6 @@ class DatasetTambahanController extends Controller
$filePath = 'dataset/' . $current . '/' . $newFilename;
$uploaded = $file->move($path, $newFilename);
// for ($i = 5; $i < count($rows); $i++) {
// $row = $rows[$i];
// // Skip baris kosong
// if (collect($row)->filter()->isEmpty()) continue;
// $assoc = [];
// foreach ($header as $j => $columnName) {
// if($columnName != null){
// $assoc[strtolower(str_replace(' ','_',$columnName))] = $row[$j] ?? null;
// }
// }
// $data[] = $assoc;
// }
}
}