52 lines
1.0 KiB
PHP
52 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Exports;
|
|
|
|
use Maatwebsite\Excel\Concerns\FromArray;
|
|
use Maatwebsite\Excel\Concerns\WithHeadings;
|
|
|
|
class OddsExporter implements FromArray, WithHeadings
|
|
{
|
|
protected array $data;
|
|
|
|
public function __construct(array $data)
|
|
{
|
|
$this->data = $data;
|
|
}
|
|
|
|
// Übergibt die flachen Zeilendaten an Excel
|
|
public function array(): array
|
|
{
|
|
return $this->data;
|
|
}
|
|
|
|
// Definiert die Kopfzeile im Excel-Sheet
|
|
public function headings(): array
|
|
{
|
|
return [
|
|
'Match Id',
|
|
'BetsApi Id',
|
|
'Betradar Id',
|
|
'Bet365 Id',
|
|
'Starttime',
|
|
'Sport Id',
|
|
'Group Id',
|
|
'Group',
|
|
'Home Id',
|
|
'Home',
|
|
'Away Id',
|
|
'Away',
|
|
'Book Id',
|
|
'Book',
|
|
'One',
|
|
'X',
|
|
'Two',
|
|
'Book Id To',
|
|
'Book To',
|
|
'Over',
|
|
'Under',
|
|
'Total',
|
|
];
|
|
}
|
|
}
|