<?php

namespace App\Exports;

use App\Models\Niveau;
use Illuminate\Support\Facades\Log;

class NiveauExport extends BaseExport
{
    protected function getExportColumns(): array
    {
        return [
            ['name' => 'id', 'label' => 'ID', 'type' => 'numeric'],
            ['name' => 'libelle', 'label' => 'Libellé', 'type' => 'text'],
            ['name' => 'cycle.libelle', 'label' => 'Cycle', 'type' => 'relationship', 'relation_field' => 'libelle'],
            ['name' => 'created_at', 'label' => 'Date de création', 'type' => 'datetime'],
            ['name' => 'updated_at', 'label' => 'Date de mise à jour', 'type' => 'datetime'],
        ];
    }

    protected function getExportTitle(): string
    {
        return 'Niveaux';
    }

    protected function getModelClass()
    {
        return Niveau::class;
    }

    protected function getRelations(): array
    {
        return ['cycle'];
    }
}
