<?php

namespace App\Imports;

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

class DepartementsImport implements ToModel
{

    //Validation des données 
    public function rules(): array
    {
        return [
            '*.name' => 'required|string',
            '*.name_of_manager' => 'required|string',
            '*.phone_of_manager' => 'required|string|min:8',
        ];
    }
    /**
     * @param array $row
     *
     * @return \Illuminate\Database\Eloquent\Model|null
     */
    public function model(array $row)
    {
        return new Departement([
            //
        ]);
    }
}