<?php

namespace App\Imports;

use App\Models\Trailers\Trailers;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Maatwebsite\Excel\Concerns\WithValidation;

class TrailerImport implements ToModel, WithHeadingRow
{
    

    public function model(array $row)
    {
        return new Trailers([
            // 'trailer_id' => $row['Trailer ID'],
            'trailer_type' => $row[8],
            'manufacturer' => $row[9],
            'model' => $row[10],
            'year' => $row[11],
            'length' => $row[12],
            'width' => $row[13],
            'height' => $row[14],
            'gvwr' => $row[15],
            'tare_weight' => $row[16],
            'payload_capacity' => $row[17],
            'status' => $row[18],
            'remarks' => $row[19],
        ]);
    }
}
