<?php

namespace App\Exports;

use Illuminate\Support\Enumerable;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;
use Mtc\MercuryDataModels\SeoData;

class SeoDataExport implements FromCollection, WithHeadings
{
    public function collection(): Enumerable
    {
        return SeoData::query()
            ->select(['path', 'title', 'description', 'heading', 'canonical', 'json_schema', 'content_description'])
            ->get();
    }

    /**
     * Export file heading row
     *
     * @return string[]
     */
    public function headings(): array
    {
        return [
            'path',
            'title',
            'description',
            'heading',
            'canonical',
            'json_schema',
            'content_description',
        ];
    }
}
