<?php

namespace App\Imports;

use App\Models\Mahasiswa;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;

class MahasiswaImport implements ToModel, WithHeadingRow
{
    public function model(array $row)
    {
        return new Mahasiswa([
            'nim'             => $row['nim'],
            'nama'            => $row['nama'],
            'alamat'          => $row['alamat'],
            'bagian'          => $row['bagian'],
            'jurusan'         => $row['jurusan'],
            'jenjang_program' => $row['jenjang_program'],
        ]);
    }
}
