From dcb6d4302690779e1a382acd92fb35eed13c115e Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Thu, 5 Jun 2025 10:44:47 +0700 Subject: [PATCH] feat(webstatement): perbaiki logika filter atribut `fillable` di `Sector` - Memperbarui logika untuk memfilter atribut array `fillable` pada model `Sector`: - Menambahkan filter untuk mengabaikan atribut `id` agar tidak terikut dalam proses. - Mengoptimalkan proses pengambilan header CSV dengan hanya menggunakan atribut yang relevan. Signed-off-by: Daeng Deni Mardaeni --- app/Jobs/ProcessSectorDataJob.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ProcessSectorDataJob.php b/app/Jobs/ProcessSectorDataJob.php index 9cc6c29..3cd8ff7 100644 --- a/app/Jobs/ProcessSectorDataJob.php +++ b/app/Jobs/ProcessSectorDataJob.php @@ -108,7 +108,9 @@ class ProcessSectorDataJob implements ShouldQueue return; } - $headers = (new Sector())->getFillable(); + $headers = array_filter((new Sector())->getFillable(), function($field) { + return $field !== 'id'; + }); $rowCount = 0; while (($row = fgetcsv($handle, 0, self::CSV_DELIMITER)) !== false) {