<?php

namespace App\Imports;

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

class PackagesImport implements ToModel
{
    /**
    * @param array $row
    *
    * @return \Illuminate\Database\Eloquent\Model|null
    */
    public function model(array $row)
    {
        return new Package([
            //
            'name' => $row[0],
            'local_address' => $row[1],
            'remote_address' => $row[2],
            'rate_limit' => $row[3],
            'price' => $row[4],
            'type'=> 'ppoe'
        ]);
    }
}
