Created
November 17, 2023 03:12
-
-
Save aldhinya/01aabd3e065fcf8c458e542e0e831734 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Exports; | |
use Maatwebsite\Excel\Concerns\FromCollection; | |
use Maatwebsite\Excel\Concerns\WithTitle; | |
use Maatwebsite\Excel\Concerns\FromView; | |
use Illuminate\Contracts\View\View; | |
use Maatwebsite\Excel\Concerns\ShouldAutoSize; | |
use Maatwebsite\Excel\Concerns\WithColumnFormatting; | |
use Maatwebsite\Excel\Concerns\WithEvents; | |
use Maatwebsite\Excel\Events\AfterSheet; | |
use PhpOffice\PhpSpreadsheet\Style\NumberFormat; | |
class DataFormCalonPelamarExport implements FromView, WithTitle, ShouldAutoSize, WithColumnFormatting | |
{ | |
private $data; | |
private $menu_form_calon_pelamar; | |
private $data_isian; | |
public function __construct($data, $menu_form_calon_pelamar, $data_isian) | |
{ | |
$this->data = $data; | |
$this->menu_form_calon_pelamar = $menu_form_calon_pelamar; | |
$this->data_isian = $data_isian; | |
} | |
public function view(): View | |
{ | |
$data = $this->data; | |
$menu_form_calon_pelamar = $this->menu_form_calon_pelamar; | |
$data_isian = $this->data_isian; | |
return view('admin.lamaran.export_form_calon_pelamar_excel', compact('data','menu_form_calon_pelamar','data_isian')); | |
} | |
public function title(): string | |
{ | |
return "Data Form Calon Pelamar"; | |
} | |
public function columnFormats(): array | |
{ | |
return [ | |
'D' => NumberFormat::FORMAT_NUMBER, | |
'E' => NumberFormat::FORMAT_NUMBER, | |
'F' => NumberFormat::FORMAT_TEXT, | |
'J' => NumberFormat::FORMAT_TEXT, | |
'P' => NumberFormat::FORMAT_NUMBER, | |
]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment