Fix: upload bulk in column date, and fix template
This commit is contained in:
@@ -38,15 +38,10 @@ class SpatialPlanningImport implements ToCollection
|
||||
}
|
||||
|
||||
foreach ($rows->skip(1) as $row) {
|
||||
$dateValue = $row[7];
|
||||
|
||||
try {
|
||||
// Coba parsing tanggal secara otomatis
|
||||
$parsedDate = Carbon::parse($dateValue)->format('Y-m-d H:i:s');
|
||||
} catch (\Exception $e) {
|
||||
// Jika gagal parsing, atur nilai default atau null
|
||||
$parsedDate = null;
|
||||
}
|
||||
$dateValue = trim($row[7]);
|
||||
info($dateValue);
|
||||
$parsedDate = Carbon::createFromFormat('Y-m-d', $dateValue)->format('Y-m-d');
|
||||
info($parsedDate);
|
||||
|
||||
$dataToInsert[] = [
|
||||
'name'=>$row[1],
|
||||
|
||||
Reference in New Issue
Block a user