openclassify/Modules/Video/Enums/VideoStatus.php
2026-03-07 17:07:32 +03:00

39 lines
893 B
PHP

<?php
namespace Modules\Video\Enums;
enum VideoStatus: string
{
case Pending = 'pending';
case Processing = 'processing';
case Ready = 'ready';
case Failed = 'failed';
public function label(): string
{
return match ($this) {
self::Pending => 'Queued',
self::Processing => 'Processing',
self::Ready => 'Ready',
self::Failed => 'Failed',
};
}
public function color(): string
{
return match ($this) {
self::Pending => 'warning',
self::Processing => 'info',
self::Ready => 'success',
self::Failed => 'danger',
};
}
public static function options(): array
{
return collect(self::cases())
->mapWithKeys(fn (self $status): array => [$status->value => $status->label()])
->all();
}
}