27 lines
480 B
PHP
27 lines
480 B
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use Maatwebsite\Excel\Concerns\FromArray;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
|
|
class UserExport implements FromArray, WithHeadings
|
|
{
|
|
public $data;
|
|
|
|
public function __construct($data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
public function headings(): array
|
|
{
|
|
return ['Username', 'Email', 'Firstname', 'Lastname', 'Organization'];
|
|
}
|
|
|
|
public function array(): array
|
|
{
|
|
return $this->data;
|
|
}
|
|
}
|