<?php

namespace App\Exports;

use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;

class PayrollExport implements FromCollection, WithHeadings
{
    protected $payrolls;

    public function __construct($payrolls)
    {
        $this->payrolls = $payrolls;
    }

    public function collection()
    {
        return collect($this->payrolls);
    }

    public function headings(): array
    {
        return [           
            'Name',
            'Phone Number',
            'Employee Number',
            'Location',
            'Department',
            'Designation',
            'Account Number',
            'IFSC Code',
            'Net Salary',
        ];
    }
}
