CasperSecurity

Current Path : /var/www/hrms.uiet.co.in/app/Exports/
Upload File :
Current File : /var/www/hrms.uiet.co.in/app/Exports/EmployeeDataExport.php

<?php

namespace App\Exports;

use App\Models\EmployeeRegistration;
use App\Models\User;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Collection;
use Maatwebsite\Excel\Concerns\Exportable;
use Maatwebsite\Excel\Concerns\FromArray;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithEvents;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Maatwebsite\Excel\Concerns\WithMapping;


class EmployeeDataExport implements FromCollection, ShouldAutoSize, WithMapping, WithHeadings, WithEvents
{
    use Exportable;


    /**
    * @return \Illuminate\Support\Collection
    */
    public function collection()
    {

        return EmployeeRegistration::all();
    }

    public function map($employeedata): array{
        return [
            $employeedata->user_id,
            $employeedata->fullname,
            $employeedata->designation,
            $employeedata->email_id,
            $employeedata->role_id,
            $employeedata->manager_id,
            $employeedata->team_id,
            $employeedata->gender,
            $employeedata->blood_group,
            $employeedata->date_of_birth,
            $employeedata->qualification,
            $employeedata->location,
            $employeedata->date_of_joining,
            $employeedata->employment_status,
        ];
    }

    public function headings(): array
    {
        return [
            'ID',
            'Full Name',
            'Designation',
            'Email',
            'Role ID',
            'Manager ID',
            'Team ID',
            'Gender',
            'Blood Group',
            'Date of Birth',
            'Qualification',
            'Location',
            'Date Of Joining',
            'Emlpoyee Status',
        ];
    }

    public function registerEvents(): array
{
    return [
        AfterSheet::class => function (AfterSheet $event) {
            $event->sheet->getStyle('A1:N1')->applyFromArray([
                'font' => [
                    'bold' => true
                ]
            ]);
        }
    ];
}
}
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY