lpj/app/Exports/PermohonanExport.php

73 lines
2.1 KiB
PHP
Raw Normal View History

2024-08-24 14:17:32 +00:00
<?php
namespace Modules\Lpj\Exports;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithColumnFormatting;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;
use Modules\Lpj\Models\Debiture;
use Modules\Lpj\Models\Permohonan;
use PhpOffice\PhpSpreadsheet\Style\NumberFormat;
class PermohonanExport implements WithColumnFormatting, WithHeadings, FromCollection, withMapping
{
public function collection()
{
return Permohonan::get();
}
public function map($row)
: array
{
return [
$row->id,
$row->nomor_registrasi,
$row->tanggal_permohonan,
$row->user->name,
$row->branch->name,
$row->tujuanPenilaian->name,
$row->debiture->name,
$row->fasilitasKredit->name,
$row->plafond->name,
2024-08-24 14:17:32 +00:00
$row->status,
$row->authorized_at,
$row->authorized_status,
$row->authorized_by,
$row->created_at
];
}
public function headings()
: array
{
return [
'ID',
'Nomor Registrasi',
'Tanggal Permohonan',
'User Pemohon',
'Branch Pemohon',
'Tujuan Penilaian',
'Debitur',
'Jenis Fasilitas Kredit',
'Nilai Plafond',
'Status Permohonan',
2024-08-24 14:17:32 +00:00
'Tanggal Pengesahan',
'Status Pengesahan',
'Pengesah',
'Tanggal Dibuat'
];
}
public function columnFormats()
: array
{
return [
'A' => NumberFormat::FORMAT_NUMBER,
'C' => NumberFormat::FORMAT_DATE_DATETIME,
'K' => NumberFormat::FORMAT_DATE_DATETIME,
'N' => NumberFormat::FORMAT_DATE_DATETIME
2024-08-24 14:17:32 +00:00
];
}
}