37 lines
733 B
PHP
37 lines
733 B
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use Maatwebsite\Excel\Concerns\FromCollection;
|
|
use App\Models\IamPrincipal;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
|
|
|
|
|
|
class customer_export implements FromCollection , WithHeadings
|
|
{
|
|
/**
|
|
* @return \Illuminate\Support\Collection
|
|
*/
|
|
public function collection()
|
|
{
|
|
return IamPrincipal::select(
|
|
'first_name',
|
|
'email_address',
|
|
'date_of_birth',
|
|
'phone_number'
|
|
)->get();
|
|
}
|
|
|
|
//function header in excel
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'first_name',
|
|
'email_address',
|
|
'date_of_birth',
|
|
'phone_number'
|
|
];
|
|
}
|
|
}
|