<?php

namespace App\Imports;

use App\Models\race_result;
use Illuminate\Support\Collection;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\ToCollection;
use Maatwebsite\Excel\Concerns\WithHeadingRow;

class PesertaHasilImport implements ToModel, WithHeadingRow
{
    /**
    * @param Collection $collection
    */
    public function collection(Collection $collection)
    { 
        //
    }

    public function model(array $row)
    {

        return new race_result ([
            'rank' =>$row['rank'],
            'name' =>$row['name'],
            'bib' =>$row['bib'],
            'cp1'=>$row['cp1'],
            'time' =>$row['time'],
            'qlf' =>$row['qlf'],
            'pace' =>$row['pace'],
            'gap' =>$row['gap'],
            'category' =>$row['category'],
            'jenis_kelamin' =>$row['jenis_kelamin'],
            'ctr_run' =>$row['ctr_run'],
        ]);
    }

   
}
