<?php

namespace App\Imports;

use Maatwebsite\Excel\Concerns\ToModel;
use Illuminate\Support\Facades\Log;
use Session;

class ImportStudent implements ToModel
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {
        if ($row[0] == '') {
            $message = 'Admission no is required.';
        } elseif ($row[1] == '') {
            $message = 'Name is required.';
        } 
        // elseif ($row[2] == '') {
        //     $message = 'Gender is required.';
        // } 
        // elseif ($row[3] == '') {
        //     $message = 'Marital Status is required.';
        // } 
        // elseif ($row[4] == '') {
        //     $message = 'Date Of Birth is required.';
        // } elseif ($row[5] == '') {
        //     $message = 'Category is required.';
        // } elseif ($row[6] == '') {
        //     $message = 'Phone No. is required.';
        // } 
        // elseif ($row[7] == '') {
        //     $message = 'Email is required.';
        // } 
        // elseif ($row[8] == '') {
        //     $message = 'Blood Group is required.';
        // } 
        // elseif ($row[9] == '') {
        //     $message = 'Address is required.';
        // } 
        // elseif ($row[10] == '') {
        //     $message = 'House is required.';
        // }
         else {
            $data['status']  = true;
            $data[] = $row;

            return $data;
        }
    }
}