initial commit
This commit is contained in:
33
app/Enums/EventStatus.php
Normal file
33
app/Enums/EventStatus.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?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',
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user