<?php

namespace App\Imports;

use Illuminate\Database\Eloquent\Model;
use Maatwebsite\Excel\Concerns\ToModel;
use Maatwebsite\Excel\Concerns\WithHeadingRow;
use Mtc\MercuryDataModels\SeoData;

class SeoHeadingImport implements ToModel, WithHeadingRow
{
    public function model(array $row): Model|array|null
    {
        return SeoData::query()
            ->updateOrCreate([
                'path' => $row['path']
            ], [
                'heading' => $row['heading'],
            ]);
    }
}
