<?php

namespace App\Exports;

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

class TemplateExport implements FromCollection,WithHeadings
{
    /**
     * Return the array data that will be used to create the Excel file.
     *
     * @return array
     */
    
     public function headings(): array
    {
        return [
            
            'Name','Mobile Number','Email', 'Company Name','Street','City','State',
            'Country','Pincode','Alternate name','Alternate phone','Priority',
           'Notes','Status','Reason',
            'APPT Date','Reason','Reason','Reason','Call Back Date','Reason',
            'Customer Type','Loan Type','Net Salary','Net Salary','Loan Amount','Business Loan'
        ];
    }

    public function collection()
    {
       // return collect([]);
       return Blank_Template::select(['name', 'mobile', 'email', 'company_name','street','city'
       ,'state','country','pincode','alternate_name','alternate_phone',
       'priority','notes','status','reason',
       'appt_date','reason1','reason2','reason3','callback_date','reason4',
       'customer_type','loan_type','net_salary','net_salary2','loan_amount','business_loan']
    )->get();          
            // Optional rows with default/template data (for the user to fill in)
          
        
    }
}
