34 lines
780 B
PHP
34 lines
780 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
enum EventStatus: string
|
|
{
|
|
case Pending = 'pending';
|
|
case InProgress = 'in_progress';
|
|
case Completed = 'completed';
|
|
case Cancelled = 'cancelled';
|
|
|
|
public function label(): string
|
|
{
|
|
return match($this) {
|
|
self::Pending => 'Pending',
|
|
self::InProgress => 'In Progress',
|
|
self::Completed => 'Completed',
|
|
self::Cancelled => 'Cancelled',
|
|
};
|
|
}
|
|
|
|
public function badgeClass(): string
|
|
{
|
|
return match($this) {
|
|
self::Pending => 'badge-warning',
|
|
self::InProgress => 'badge-info',
|
|
self::Completed => 'badge-success',
|
|
self::Cancelled => 'badge-error',
|
|
};
|
|
}
|
|
}
|