mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-25 23:43:58 +00:00
40 lines
919 B
Plaintext
40 lines
919 B
Plaintext
<?php
|
|
|
|
namespace App\Classes\Modules\Exports\Services;
|
|
|
|
use App\Classes\ValueObjects\Constants\BusinessType;
|
|
use App\Classes\ValueObjects\Constants\CompanyType;
|
|
use App\Models\Company;
|
|
use App\Models\User;
|
|
use Maatwebsite\Excel\Concerns\Exportable;
|
|
use Maatwebsite\Excel\Concerns\FromQuery;
|
|
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
|
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
use Maatwebsite\Excel\Concerns\WithMapping;
|
|
|
|
class ExportsUsers implements FromQuery, WithHeadings, WithHeadingRow, WithMapping, ShouldAutoSize
|
|
{
|
|
use Exportable;
|
|
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'User',
|
|
'Email'
|
|
];
|
|
}
|
|
|
|
public function query()
|
|
{
|
|
return User::query();
|
|
}
|
|
public function map($users): array
|
|
{
|
|
|
|
return [
|
|
$users->name,
|
|
$users->email
|
|
];
|
|
}
|
|
} |