<?php

namespace App\Exports;

use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithStyles;
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;

class SiswaTemplateExport implements FromArray, WithHeadings, WithStyles
{
    public function headings(): array
    {
        return [
            'Nama',
            'Email',
            'Password',
            'NIS',
            'Kelas',
        ];
    }

    public function array(): array
    {
        return [
            [
                'Farhan Akbar',
                'farhan@sipena.com',
                'password',
                '25017',
                '5B',
            ],
            [
                'Alya Safitri',
                'alya@sipena.com',
                'password',
                '25018',
                '5B',
            ],
        ];
    }

    public function styles(Worksheet $sheet): array
    {
        return [
            1 => [
                'font' => ['bold' => true],
                'alignment' => [
                    'horizontal' => \PhpOffice\PhpSpreadsheet\Style\Alignment::HORIZONTAL_LEFT,
                ],
            ],
        ];
    }
}
