Files
cheerstothe_season_2.0/app/Exports/customer_export.php
sayaliparab b5520f6e51 CustomerApp
2024-05-28 18:53:50 +05:30

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'
];
}
}