quiniela-sembradores-backend/app/Enums/MatchStatus.php

36 lines
729 B
PHP
Raw Normal View History

2026-03-19 18:18:18 -06:00
<?php
namespace App\Enums;
enum MatchStatus: string
{
case Scheduled = 'scheduled';
case InProgress = 'in_progress';
case Finished = 'finished';
case Cancelled = 'cancelled';
public function label(): string
{
return match ($this) {
self::Scheduled => 'Scheduled',
self::InProgress => 'In progress',
self::Finished => 'Finished',
self::Cancelled => 'Cancelled',
};
}
/**
* @return array<string, string>
*/
public static function options(): array
{
$options = [];
foreach (self::cases() as $case) {
$options[$case->value] = $case->label();
}
return $options;
}
}