mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-05-07 20:32:26 +00:00
36 lines
694 B
PHP
36 lines
694 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
use Maatwebsite\Excel\Excel;
|
|
|
|
enum ExportFormat: string
|
|
{
|
|
case CSV = 'csv';
|
|
case PDF = 'pdf';
|
|
case XLSX = 'xlsx';
|
|
case ODS = 'ods';
|
|
|
|
public function getFileExtension(): string
|
|
{
|
|
return match ($this) {
|
|
self::CSV => 'csv',
|
|
self::PDF => 'pdf',
|
|
self::XLSX => 'xlsx',
|
|
self::ODS => 'ods',
|
|
};
|
|
}
|
|
|
|
public function getExportPackageType(): string
|
|
{
|
|
return match ($this) {
|
|
self::CSV => Excel::CSV,
|
|
self::PDF => Excel::MPDF,
|
|
self::XLSX => Excel::XLSX,
|
|
self::ODS => Excel::ODS,
|
|
};
|
|
}
|
|
}
|