38 lines
847 B
PHP
38 lines
847 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
enum EventStatus: string
|
|
{
|
|
case Draft = 'draft';
|
|
case Pending = 'pending';
|
|
case Confirmed = 'confirmed';
|
|
case Completed = 'completed';
|
|
case Cancelled = 'cancelled';
|
|
|
|
public function label(): string
|
|
{
|
|
return match ($this) {
|
|
self::Draft => 'Draft',
|
|
self::Pending => 'Pending Confirmation',
|
|
self::Confirmed => 'Confirmed',
|
|
self::Completed => 'Completed',
|
|
self::Cancelled => 'Cancelled',
|
|
};
|
|
}
|
|
|
|
public function color(): string
|
|
{
|
|
return match ($this) {
|
|
self::Draft => 'secondary',
|
|
self::Pending => 'warning',
|
|
self::Confirmed => 'success',
|
|
self::Completed => 'info',
|
|
self::Cancelled => 'error',
|
|
};
|
|
}
|
|
}
|
|
|