From 20bae06ab676a4b2a6c6a315111d5ac3fd24e3d9 Mon Sep 17 00:00:00 2001 From: Daeng Deni Mardaeni Date: Fri, 15 Nov 2024 09:49:08 +0700 Subject: [PATCH] Tambah fitur ekspor kalender libur Menambahkan kelas `HolidayCalendarExport` yang mengimplementasikan berbagai antarmuka dari Maatwebsite Excel untuk mendukung ekspor data kalender libur. Data yang diekspor mencakup ID, tanggal, deskripsi, tipe, dan tanggal pembuatan serta pembaruan dengan format kolom yang sesuai. --- app/Exports/HolidayCalendarExport.php | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 app/Exports/HolidayCalendarExport.php diff --git a/app/Exports/HolidayCalendarExport.php b/app/Exports/HolidayCalendarExport.php new file mode 100644 index 0000000..dc850af --- /dev/null +++ b/app/Exports/HolidayCalendarExport.php @@ -0,0 +1,52 @@ +id, + $row->date, + $row->description, + $row->type, + $row->created_at, + $row->updated_at + ]; + } + + public function headings(): array + { + return [ + 'ID', + 'Date', + 'Description', + 'Type', + 'Created At', + 'Updated At' + ]; + } + + public function columnFormats(): array + { + return [ + 'A' => NumberFormat::FORMAT_NUMBER, + 'B' => NumberFormat::FORMAT_DATE_DDMMYYYY, + 'E' => NumberFormat::FORMAT_DATE_DATETIME, + 'F' => NumberFormat::FORMAT_DATE_DATETIME + ]; + } +}