CasperSecurity

Current Path : /var/www/hrms.uiet.co.in/app/Imports/
Upload File :
Current File : /var/www/hrms.uiet.co.in/app/Imports/HolidayImport.php

<?php

namespace App\Imports;

use App\Models\Holiday;
use Carbon\Carbon;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithUpserts;

class HolidayImport implements ToModel, WithHeadingRow,WithUpserts
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {

        return new Holiday([
            'holiday_type_id'=>$row['holiday_type_id'],
            'holiday'=>$row['holiday'],
            'start_dt'=>Carbon::parse($row['start_dt'])->format('Y-m-d'),
            'end_dt'=>Carbon::parse($row['end_dt'])->format('Y-m-d'),
            'no_of_days'=>$row['no_of_days'],
        ]);
    }

    public function uniqueBy()
    {
        return 'start_dt';
    }
}
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