<?php

namespace App\Imports;

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


class AccountTypeImport implements ToModel, WithHeadingRow
{ 
    public function model(array $row)
    {
        if(!empty($row['number']) && !empty($row['name'])){
        $account_type= new AccountType;
        $account_type->number = $row['number'];
        $account_type->name = $row['name'];
        $account_type->save();
        return  $account_type;
        }
       
       
    }
}
