MMCT TEAM
Server IP : 103.191.208.50  /  Your IP : 216.73.216.53
Web Server : LiteSpeed
System : Linux orion.herosite.pro 4.18.0-553.53.1.lve.el8.x86_64 #1 SMP Wed May 28 17:01:02 UTC 2025 x86_64
User : celkcksm ( 1031)
PHP Version : 7.4.33
Disable Function : show_source, system, shell_exec, passthru, popen, exec
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /home/celkcksm/hrms.ncriptech.com/app/Exports/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/celkcksm/hrms.ncriptech.com/app/Exports/SalaryReportExport.php
<?php

namespace App\Exports;

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

class SalaryReportExport implements FromCollection, WithHeadings
{
    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {
        $records= SalarySheetReport::except(['id', 'created_at', 'updated_at'])->get();

        $result = array();
        foreach($records as $record){
           $result[] = array(
                'id'=>$record->sl_no,
                'name_of_the_employee'=>$record->name_of_the_employee,
                'designation'=>$record->designation,
                'w_days'=>$record->w_days,
                'present'=>$record->present,
                'absent'=>$record->absent,
                'tardy'=>$record->tardy,
                'tardy_days'=>$record->tardy_days,
                'gross_salary'=>$record->gross_salary,
                'basic_50'=>$record->basic_50,
                'hra_40'=>$record->hra_40,
                'medical_10'=>$record->medical_10,
                'performance_incentive'=>$record->performance_incentive,
                'absent_amount'=>$record->absent_amount,
                'advance'=>$record->advance,
                'tardy_amount'=>$record->tardy_amount,
                'incentive'=>$record->incentive,
                'net_salary'=>$record->net_salary,

           );
        }

        return collect($result);
    }
    public function headings(): array
    {
        return [
            'SL No',
            'Name of the Employee',
            'Designation',
            'W Days',
            'Present',
            'Absent',
            'Tardy',
            'Tardy Days',
            'Gross Salary',
            'Basic (50%)',
            'HRA (40%)',
            'Medical (10%)',
            'Performance Incentive',
            'Absent',
            'Tardy Amount',
            'Incentive',
            'Net Salary',
        ];
    }
}

MMCT - 2023