<?php

namespace App\Exports;

use App\Demand;
use Maatwebsite\Excel\Concerns\FromCollection;
use Maatwebsite\Excel\Concerns\WithHeadings;

class DemandsExport implements FromCollection, WithHeadings
{
    public function collection()
    {
        return Demand::select('id', 'user_id', 'song', 'artist', 'lyrics', 'type', 'is_read', 'created_at', 'updated_at')->get();
    }

    public function headings(): array
    {
        return ['id', 'user_id', 'song', 'artist', 'lyrics', 'type', 'is_read', 'created_at', 'updated_at'];
    }
}
