<?php

namespace App\Exports;

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

class CustomersExport implements FromCollection, WithHeadings
{
    public function collection()
    {
        return Customer::select('id', 'full_name', 'phone', 'email', 'cnic', 'city', 'customer_type', 'created_at')->get();
    }

    public function headings(): array
    {
        return [
            'ID',
            'Full Name',
            'Phone',
            'Email',
            'CNIC',
            'City',
            'Type',
            'Registered At'
        ];
    }
}
