update
parent
63cbe19971
commit
f9ce9672bc
|
|
@ -152,9 +152,7 @@ class DatasetTambahanController extends Controller
|
||||||
// $sheet = $spreadsheet->getActiveSheet();
|
// $sheet = $spreadsheet->getActiveSheet();
|
||||||
// $rows = $sheet->toArray();
|
// $rows = $sheet->toArray();
|
||||||
// $header = $rows[4]; // Baris pertama sebagai header
|
// $header = $rows[4]; // Baris pertama sebagai header
|
||||||
if (@$request->hasFile('file')) {
|
|
||||||
$file = $request->file('file');
|
|
||||||
dd($file);
|
|
||||||
$destinationPath = public_path('uploads/dataset');
|
$destinationPath = public_path('uploads/dataset');
|
||||||
$current = Carbon::now()->format('Y/m/d');
|
$current = Carbon::now()->format('Y/m/d');
|
||||||
$path = $destinationPath . '/' . $current;
|
$path = $destinationPath . '/' . $current;
|
||||||
|
|
@ -176,26 +174,6 @@ class DatasetTambahanController extends Controller
|
||||||
|
|
||||||
$filePath = 'dataset/' . $current . '/' . $newFilename;
|
$filePath = 'dataset/' . $current . '/' . $newFilename;
|
||||||
$uploaded = $file->move($path, $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;
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue