<?php

namespace App\Exports;

use App\Models\Phase;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;

class PhasesExport implements FromCollection, WithHeadings
{
    public function collection()
    {
        return Phase::select([
            'id',
            'project_id',
            'name',
            'progress_percent',
            'start_date',
            'end_date',
            'created_at',
            'updated_at',
        ])->get();
    }

    public function headings(): array
    {
        return [
            'ID',
            'ID Proyecto',
            'Nombre',
            'Progreso (%)',
            'Fecha de inicio',
            'Fecha de fin',
            'Creado el',
            'Actualizado el',
        ];
    }
}
