PK

ADDRLIN : /home/questend/public_html/subdomain/payroll.questend.com/app/Exports/
FLL :
Current File : /home/questend/public_html/subdomain/payroll.questend.com/app/Exports/BankAdviceExport.php

<?php

namespace App\Exports;

use App\Models\Payroll;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;

class BankAdviceExport implements FromCollection, WithHeadings
{
    protected int $month;
    protected int $year;

    public function __construct(int $month, int $year)
    {
        $this->month = $month;
        $this->year  = $year;
    }

    public function collection()
    {
        return Payroll::with('employee')
            ->where('month', $this->month)
            ->where('year', $this->year)
            ->get()
            ->map(fn($p) => [
                $p->employee->name,
                $p->employee->bank_account,
                $p->employee->ifsc,
                $p->net
            ]);
    }

    public function headings(): array
    {
        return [
            'Employee Name',
            'Account Number',
            'IFSC Code',
            'Net Amount'
        ];
    }
}


PK 99
E-SHOP || DASHBOARD
404

Page Not Found

It looks like you found a glitch in the matrix...

← Back to Home