<?php

namespace App\Imports;

use App\Models\Student;
use Maatwebsite\Excel\Concerns\ToModel;

class StudentImport implements ToModel
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {
        return new Student([
            'admission_no'=>$row[0],
        'name'=>$row[1],
        'schclass_id'=>$row[2],
        'enrollment_year'=>$row[3],
        'state_id'=>$row[4],
        'lga_id'=>$row[5],
        'dob'=>$row[6],
        'gender'=>$row[7],
        'blood_group'=>$row[8],
        'address'=>$row[9],
        'phone'=>$row[10],
        ]);
    }
}
